Changeset 12279


Ignore:
Timestamp:
Jun 23, 2009, 5:06:46 PM (10 years ago)
Author:
mikel
Message:

Ticket #471: fixed a buglet in the check-in (updated the wrong function!)

File:
1 edited

Legend:

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

    r12278 r12279  
    6262  (setf (hi::hemlock-view-quote-next-p hi::*current-view*) :native))
    6363
    64 #| the old way
    65 (defcommand "Forward Character" (p)
    66   "Move the point forward one character, collapsing the selection.
    67    With prefix argument move that many characters, with negative argument
    68    go backwards."
    69   "Move the point of the current buffer forward p characters, collapsing the selection."
    70   (let* ((p (or p 1))
    71          (point (current-point-collapsing-selection)))
    72     (cond ((character-offset point p))
    73           ((= p 1)
    74            (editor-error "No next character."))
    75           ((= p -1)
    76            (editor-error "No previous character."))
    77           (t
    78            (if (plusp p)
    79                (buffer-end point)
    80                (buffer-start point))
    81            (editor-error "Not enough characters.")))))
    82 |#
    83 
    84 ;;; experimental: if there is an active region, we want to collapse the selection to the end,
    85 ;;; rather than collapse it AND move forward one character
     64
    8665(defcommand "Forward Character" (p)
    8766    "Move the point forward one character, collapsing the selection.
     
    8968   go backwards."
    9069    "Move the point of the current buffer forward p characters, collapsing the selection."
    91   (let* ((p (cond
    92               (p p)
    93               ((hi::%buffer-current-region-p hi::*current-buffer*) 0)
    94               (t 1)))
    95          (point (current-point-collapsing-selection)))
    96     (cond ((character-offset point p))
    97           ((= p 1)
    98            (editor-error "No next character."))
    99           ((= p -1)
    100            (editor-error "No previous character."))
    101           (t
    102            (if (plusp p)
    103                (buffer-end point)
    104                (buffer-start point))
    105            (editor-error "Not enough characters.")))))
    106 
    107 (defcommand "Select Forward Character" (p)
    108     "Move the point forward one character, extending the selection.
    109    With prefix argument move that many characters, with negative argument
    110    go backwards."
    111     "Move the point of the current buffer forward p characters, extending the selection."
    11270  (if (hi::%buffer-current-region-p hi::*current-buffer*)
    11371      (multiple-value-bind (start end)(region-bounds (current-region nil nil))
     
    13088               (editor-error "Not enough characters."))))))
    13189
    132 #| the old way
    133 (defcommand "Backward Character" (p)
    134   "Move the point backward one character, collapsing the selection.
    135   With prefix argument move that many characters backward."
    136   "Move the point p characters backward, collapsing the selection."
    137   (forward-character-command (if p (- p) -1)))
    138 |#
    139 
    140 ;;; experimental: if there is an active region, we want to collapse the selection to the start,
    141 ;;; rather than collapse it AND move backward one character
     90
     91(defcommand "Select Forward Character" (p)
     92    "Move the point forward one character, extending the selection.
     93   With prefix argument move that many characters, with negative argument
     94   go backwards."
     95    "Move the point of the current buffer forward p characters, extending the selection."
     96  (let* ((p (cond
     97                  (p p)
     98                  ((hi::%buffer-current-region-p hi::*current-buffer*) 0)
     99                  (t 1)))
     100             (point (current-point-collapsing-selection)))
     101        (cond ((character-offset point p))
     102              ((= p 1)
     103               (editor-error "No next character."))
     104              ((= p -1)
     105               (editor-error "No previous character."))
     106              (t
     107               (if (plusp p)
     108                   (buffer-end point)
     109                   (buffer-start point))
     110               (editor-error "Not enough characters.")))))
     111
    142112(defcommand "Backward Character" (p)
    143113    "Move the point backward one character, collapsing the selection.
Note: See TracChangeset for help on using the changeset viewer.