Changeset 11894


Ignore:
Timestamp:
Apr 4, 2009, 8:09:08 PM (11 years ago)
Author:
rme
Message:

Editor Evaluate Region: if no region is active, and point is not
before an open paren or after a close paren, try to evaluate the
thing that point is before/in/after.

It can choke if point is within or after something like #\c or
#&NSFontAttributeName (although if point is before such a thing, it
works).

File:
1 edited

Legend:

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

    r8428 r11894  
    478478        (cond ((eql (next-character point) #\()
    479479               (with-mark ((m point))
    480                  (if (list-offset m 1)
     480                 (if (form-offset m 1)
    481481                   (eval-region (region point m)))))
    482482              ((eql (previous-character point) #\))
    483483               (with-mark ((m point))
    484                  (if (list-offset m -1)
    485                    (eval-region (region m point))))))))))
    486            
     484                 (if (form-offset m -1)
     485                   (eval-region (region m point)))))
     486              (t
     487               (with-mark ((start point)
     488                           (end point))
     489                 (when (mark-symbol start end)
     490                   (eval-region (region start end))))))))))
     491
    487492(defcommand "Editor Re-evaluate Defvar" (p)
    488493  "Evaluate the current or next top-level form if it is a DEFVAR.  Treat the
Note: See TracChangeset for help on using the changeset viewer.