Commit 704d3ae7 authored by Juri Linkov's avatar Juri Linkov
Browse files

(isearch-highlight): Change main overlay priority from 1 to 1001. Simplify.

(isearch-lazy-highlight-update): Change lazy overlay priority from 0 to 1000.
parent 9cf328cc
......@@ -2235,17 +2235,15 @@ since they have special meaning in a regexp."
(defvar isearch-overlay nil)
(defun isearch-highlight (beg end)
(unless (null search-highlight)
(cond (isearch-overlay
;; Overlay already exists, just move it.
(move-overlay isearch-overlay beg end (current-buffer)))
(t
;; Overlay doesn't exist, create it.
(setq isearch-overlay (make-overlay beg end))
(overlay-put isearch-overlay 'face isearch)
(overlay-put isearch-overlay 'priority 1) ;higher than lazy overlays
))))
(if search-highlight
(if isearch-overlay
;; Overlay already exists, just move it.
(move-overlay isearch-overlay beg end (current-buffer))
;; Overlay doesn't exist, create it.
(setq isearch-overlay (make-overlay beg end))
;; 1001 is higher than lazy's 1000 and ediff's 100+
(overlay-put isearch-overlay 'priority 1001)
(overlay-put isearch-overlay 'face isearch))))
(defun isearch-dehighlight ()
(when isearch-overlay
......@@ -2409,8 +2407,10 @@ Attempt to do the search exactly the way the pending isearch would."
;; non-zero-length match
(let ((ov (make-overlay mb me)))
(push ov isearch-lazy-highlight-overlays)
;; 1000 is higher than ediff's 100+,
;; but lower than isearch main overlay's 1001
(overlay-put ov 'priority 1000)
(overlay-put ov 'face lazy-highlight-face)
(overlay-put ov 'priority 0) ;lower than main overlay
(overlay-put ov 'window (selected-window))))
(if isearch-forward
(setq isearch-lazy-highlight-end (point))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment