Changeset 14211


Ignore:
Timestamp:
Aug 24, 2010, 9:41:42 PM (9 years ago)
Author:
rme
Message:

Add a special-case to Hemlock command Indent Form so that it will indent
the previous form if point is immediately to the right of a #\).

See ticket:723.

File:
1 edited

Legend:

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

    r14209 r14211  
    14561456
    14571457(defcommand "Indent Form" (p)
    1458   "Indent Lisp code in the next form."
     1458  "Indent Lisp code in the next form, unless point is to the right of
     1459   a closing parenthesis, in which case the previous form will be
     1460   indented."
    14591461  "Indent Lisp code in the next form."
    14601462  (declare (ignore p))
    1461   (let ((point (current-point)))
     1463  (let ((point (current-point))
     1464        (offset 1))
    14621465    (pre-command-parse-check point)
     1466    (when (eql (previous-character point) #\))
     1467      (setq offset -1))
    14631468    (with-mark ((m point))
    1464       (unless (form-offset m 1) (editor-error))
     1469      (unless (form-offset m offset) (editor-error))
     1470      (when (minusp offset)
     1471        (rotatef point m))
    14651472      (lisp-indent-region (region point m) "Indent Form"))))
    14661473
Note: See TracChangeset for help on using the changeset viewer.