Changeset 14812


Ignore:
Timestamp:
Jun 6, 2011, 6:22:07 PM (8 years ago)
Author:
svspire
Message:

Invert sense of arg in "Exchange Point and Mark" to be more like Fred.
Add "I-Search Yank Selection" plus (commented-out) binding to control-y
to provide Fred-like capability to select a string then control-s control-y
control-s to search for other instances of that string.
Left binding commented out for people who depend on current binding of control-y.

Location:
trunk/source/cocoa-ide/hemlock/src
Files:
3 edited

Legend:

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

    r14734 r14812  
    7575(bind-key "Universal Argument" #k"control-u")
    7676(bind-key "Scroll Window Down" #k"control-v")
     77;(bind-key "I-Search Yank Selection" #k"control-y" :mode "I-Search") ; uncomment if you want Fred-like behavior
    7778(bind-key "Page Down" #k"pagedown")
    7879(bind-key "Scroll Window Up" #k"meta-v")
  • trunk/source/cocoa-ide/hemlock/src/isearchcoms.lisp

    r8428 r14812  
    134134        "Internal variable containing current state of I-Search"
    135135        :buffer buffer))
    136     (push-new-buffer-mark (current-point))
     136    (unless (region-active-p) ; We need the selection (if there is one) to stay put!
     137      (push-new-buffer-mark (current-point)))
    137138    (setf (value i-search-state) iss)
    138139    (%i-search-message iss)))
     
    140141(defun end-isearch-mode ()
    141142  (setf (buffer-minor-mode (current-buffer) "I-Search") nil))
     143
     144(defcommand "I-Search Yank Selection" (p)
     145   "Pull string from current selection into search string."
     146  (declare (ignore p))
     147  (let* ((iss (current-isearch-state)))
     148    (i-search-extend iss (region-to-string (region (current-mark) (current-point))))))
    142149
    143150(defun i-search-backup (iss)
  • trunk/source/cocoa-ide/hemlock/src/killcoms.lisp

    r14737 r14812  
    180180
    181181(defcommand "Exchange Point and Mark" (p)
    182   "Swap the positions of the point and the mark, activating region.
    183    With a prefix argument, deactivates region"
     182  "Swap the positions of the point and the mark, deactivating region.
     183   With a prefix argument, activates region"
    184184  (let ((point (current-point))
    185185        (mark (current-mark)))
     
    188188      (move-mark mark temp)))
    189189  (if p
    190     (deactivate-region)
    191     (activate-region)))
     190    (activate-region)
     191    (deactivate-region)))
    192192
    193193(defcommand "Mark Whole Buffer"  (p)
Note: See TracChangeset for help on using the changeset viewer.