Commit 68ebbb95 authored by Gerd Moellmann's avatar Gerd Moellmann
Browse files

(isearch-lazy-highlight-max): New user-option.

(isearch-lazy-highlight-update): Don't highlight more than
isearch-lazy-highlight-max matches.
parent 8062e53a
......@@ -1871,6 +1871,12 @@ If this is nil, extra highlighting can be \"manually\" removed with
:type 'number
:group 'isearch-lazy-highlight)
(defcustom isearch-lazy-highlight-max 20
"*Maximum number of matches to highlight."
:type '(choice (const :tag "All" nil)
(integer :tag "Some"))
:group 'isearch-lazy-highlight)
(defgroup isearch-faces nil
"Lazy highlighting feature for incremental search."
:version "21.1"
......@@ -1961,7 +1967,10 @@ Attempt to do the search exactly the way the pending isearch would."
(defun isearch-lazy-highlight-update ()
"Find and highlight the next match in the lazy highlighting loop."
(when (not isearch-invalid-regexp)
(when (and (not isearch-invalid-regexp)
(or (null isearch-lazy-highlight-max)
(< (length isearch-lazy-highlight-overlays)
(goto-char (if isearch-forward
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