Changeset 12286


Ignore:
Timestamp:
Jun 24, 2009, 4:08:16 PM (10 years ago)
Author:
mikel
Message:

collapse-if-selection was modifying point in a way that confused subsequent movement commands; that is now fixed.

File:
1 edited

Legend:

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

    r12285 r12286  
    1717;;; utility for collapsing selections from movement commands
    1818;;; returns a true value if a selection was collapsed, false otherwise
    19 (defun collapse-if-selection (&key (direction :forward))
    20   (assert (memq direction '(:backward :forward))()
    21           "collapse-if-selection requires a :direction argument equal to either :backward or :forward")
    22   (if (hi::%buffer-current-region-p hi::*current-buffer*)
    23       (multiple-value-bind (start end)(region-bounds (current-region nil nil))
    24         (let ((d (ecase direction ((:forward) end)((:backward) start))))
    25           (setf (buffer-point hi::*current-buffer*) d)
    26           (setf (hi::buffer-region-active hi::*current-buffer*) nil)
    27           t))
    28       nil))
    2919
    3020(defun collapse-if-selection (&key (direction :forward))
     
    4232          point)
    4333        nil)))
    44 
    4534
    4635;;; Make a mark for buffers as they're consed:
Note: See TracChangeset for help on using the changeset viewer.