Changeset 11972


Ignore:
Timestamp:
Apr 27, 2009, 6:06:51 AM (10 years ago)
Author:
gb
Message:

NEW-LINE-COMMAND: insert #\newline(s), even if surrounded by blank lines
(ticket:191).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/cocoa-ide/hemlock/src/indent.lisp

    r8153 r11972  
    193193(defcommand "New Line" (p)
    194194  "Moves the point to a new blank line.
    195   A newline is inserted if the next two lines are not already blank.
     195  A newline is inserted.
    196196  With an argument, repeats p times."
    197197  "Moves the point to a new blank line."
     
    199199        (count (if p p 1)))
    200200    (if (not (minusp count))
    201         (do* ((next (line-next (mark-line point))
    202                     (line-next (mark-line point)))
    203               (i 1 (1+ i)))
    204              ((> i count))
    205           (cond ((and (blank-after-p point)
    206                       next (blank-line-p next)
    207                       (let ((after (line-next next)))
    208                         (or (not after) (blank-line-p after))))
    209                  (line-start point next)
    210                  (let ((len (line-length next)))
    211                    (unless (zerop len)
    212                      (delete-characters point len))))
    213                 (t
    214                  (insert-character point #\newline))))
    215         (editor-error))))
     201      (dotimes (i count) (insert-character point #\newline))
     202      (editor-error))))
    216203
    217204
Note: See TracChangeset for help on using the changeset viewer.