[Openmcl-cvs-notifications] r16361 - /trunk/source/cocoa-ide/hemlock/src/edit-defs.lisp

gz at clozure.com gz at clozure.com
Mon Mar 30 22:18:02 UTC 2015


Author: gz
Date: Mon Mar 30 22:18:02 2015
New Revision: 16361

Log:
Fix backward search case in move-to-source-note

Modified:
    trunk/source/cocoa-ide/hemlock/src/edit-defs.lisp

Modified: trunk/source/cocoa-ide/hemlock/src/edit-defs.lisp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/source/cocoa-ide/hemlock/src/edit-defs.lisp	(original)
+++ trunk/source/cocoa-ide/hemlock/src/edit-defs.lisp	Mon Mar 30 22:18:02 2=
015
@@ -347,11 +347,19 @@
             (pattern nil)
             (offset 0))
         (flet ((ssearch (mark string direction)
-                 (find-pattern mark
-                               (setq pattern (new-search-pattern :string-i=
nsensitive
-                                                                 direction
-                                                                 string
-                                                                 pattern))=
)))
+                 (or (find-pattern mark
+                                   (setq pattern (new-search-pattern :stri=
ng-insensitive
+                                                                     direc=
tion
+                                                                     string
+                                                                     patte=
rn)))
+                     ;; above will fail if mark is the middle of the strin=
g, because backward
+                     ;; searches don't match anything past the mark.
+                     (when (eq direction :backward)
+                       (with-mark ((temp-mark mark))
+                         (unless (character-offset temp-mark (length strin=
g))
+                           (buffer-end temp-mark))
+                         (when (find-pattern temp-mark pattern)
+                           (move-mark mark temp-mark)))))))
           (declare (inline ssearch))
           (with-mark ((temp-mark (current-point)))
             (unless full-text



More information about the Openmcl-cvs-notifications mailing list