diff options
| author | Juri Linkov | 2004-09-08 20:43:17 +0000 |
|---|---|---|
| committer | Juri Linkov | 2004-09-08 20:43:17 +0000 |
| commit | 5ee5cd10177c16cd5b65b97faf87f3ab1dfc9129 (patch) | |
| tree | 43a66134a8b56e0cdc527573b3a66927a0866ac7 | |
| parent | 2a075e376bdf5842812d75385912fb40c0416707 (diff) | |
| download | emacs-5ee5cd10177c16cd5b65b97faf87f3ab1dfc9129.tar.gz emacs-5ee5cd10177c16cd5b65b97faf87f3ab1dfc9129.zip | |
(isearch-lazy-highlight-update): Take into account
the case of zero-length match at the search bound.
| -rw-r--r-- | lisp/isearch.el | 39 |
1 files changed, 25 insertions, 14 deletions
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." | |||
| 2402 | (let ((mb (match-beginning 0)) | 2402 | (let ((mb (match-beginning 0)) |
| 2403 | (me (match-end 0))) | 2403 | (me (match-end 0))) |
| 2404 | (if (= mb me) ;zero-length match | 2404 | (if (= mb me) ;zero-length match |
| 2405 | (forward-char 1) | 2405 | (if isearch-forward |
| 2406 | (if (= mb (if isearch-lazy-highlight-wrapped | ||
| 2407 | isearch-lazy-highlight-start | ||
| 2408 | (window-end))) | ||
| 2409 | (setq found nil) | ||
| 2410 | (forward-char 1)) | ||
| 2411 | (if (= mb (if isearch-lazy-highlight-wrapped | ||
| 2412 | isearch-lazy-highlight-end | ||
| 2413 | (window-start))) | ||
| 2414 | (setq found nil) | ||
| 2415 | (forward-char -1))) | ||
| 2406 | 2416 | ||
| 2407 | ;; non-zero-length match | 2417 | ;; non-zero-length match |
| 2408 | (let ((ov (make-overlay mb me))) | 2418 | (let ((ov (make-overlay mb me))) |
| @@ -2412,19 +2422,20 @@ Attempt to do the search exactly the way the pending isearch would." | |||
| 2412 | (push ov isearch-lazy-highlight-overlays))) | 2422 | (push ov isearch-lazy-highlight-overlays))) |
| 2413 | (if isearch-forward | 2423 | (if isearch-forward |
| 2414 | (setq isearch-lazy-highlight-end (point)) | 2424 | (setq isearch-lazy-highlight-end (point)) |
| 2415 | (setq isearch-lazy-highlight-start (point)))) | 2425 | (setq isearch-lazy-highlight-start (point))))) |
| 2416 | 2426 | ||
| 2417 | ;; not found | 2427 | ;; not found or zero-length match at the search bound |
| 2418 | (if isearch-lazy-highlight-wrapped | 2428 | (if (not found) |
| 2419 | (setq looping nil | 2429 | (if isearch-lazy-highlight-wrapped |
| 2420 | nomore t) | 2430 | (setq looping nil |
| 2421 | (setq isearch-lazy-highlight-wrapped t) | 2431 | nomore t) |
| 2422 | (if isearch-forward | 2432 | (setq isearch-lazy-highlight-wrapped t) |
| 2423 | (progn | 2433 | (if isearch-forward |
| 2424 | (setq isearch-lazy-highlight-end (window-start)) | 2434 | (progn |
| 2425 | (goto-char (window-start))) | 2435 | (setq isearch-lazy-highlight-end (window-start)) |
| 2426 | (setq isearch-lazy-highlight-start (window-end)) | 2436 | (goto-char (window-start))) |
| 2427 | (goto-char (window-end))))))) | 2437 | (setq isearch-lazy-highlight-start (window-end)) |
| 2438 | (goto-char (window-end))))))) | ||
| 2428 | (unless nomore | 2439 | (unless nomore |
| 2429 | (setq isearch-lazy-highlight-timer | 2440 | (setq isearch-lazy-highlight-timer |
| 2430 | (run-at-time isearch-lazy-highlight-interval nil | 2441 | (run-at-time isearch-lazy-highlight-interval nil |