From: Juri Linkov Date: Wed, 8 Sep 2004 20:43:17 +0000 (+0000) Subject: (isearch-lazy-highlight-update): Take into account X-Git-Tag: ttn-vms-21-2-B4~4983 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5ee5cd10177c16cd5b65b97faf87f3ab1dfc9129;p=emacs.git (isearch-lazy-highlight-update): Take into account the case of zero-length match at the search bound. --- diff --git a/lisp/isearch.el b/lisp/isearch.el index 572553d816a..2398d56ab5f 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -2402,7 +2402,17 @@ Attempt to do the search exactly the way the pending isearch would." (let ((mb (match-beginning 0)) (me (match-end 0))) (if (= mb me) ;zero-length match - (forward-char 1) + (if isearch-forward + (if (= mb (if isearch-lazy-highlight-wrapped + isearch-lazy-highlight-start + (window-end))) + (setq found nil) + (forward-char 1)) + (if (= mb (if isearch-lazy-highlight-wrapped + isearch-lazy-highlight-end + (window-start))) + (setq found nil) + (forward-char -1))) ;; non-zero-length match (let ((ov (make-overlay mb me))) @@ -2412,19 +2422,20 @@ Attempt to do the search exactly the way the pending isearch would." (push ov isearch-lazy-highlight-overlays))) (if isearch-forward (setq isearch-lazy-highlight-end (point)) - (setq isearch-lazy-highlight-start (point)))) - - ;; not found - (if isearch-lazy-highlight-wrapped - (setq looping nil - nomore t) - (setq isearch-lazy-highlight-wrapped t) - (if isearch-forward - (progn - (setq isearch-lazy-highlight-end (window-start)) - (goto-char (window-start))) - (setq isearch-lazy-highlight-start (window-end)) - (goto-char (window-end))))))) + (setq isearch-lazy-highlight-start (point))))) + + ;; not found or zero-length match at the search bound + (if (not found) + (if isearch-lazy-highlight-wrapped + (setq looping nil + nomore t) + (setq isearch-lazy-highlight-wrapped t) + (if isearch-forward + (progn + (setq isearch-lazy-highlight-end (window-start)) + (goto-char (window-start))) + (setq isearch-lazy-highlight-start (window-end)) + (goto-char (window-end))))))) (unless nomore (setq isearch-lazy-highlight-timer (run-at-time isearch-lazy-highlight-interval nil