[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master eae4541: [el-search] Add accessible buffer area to a valid
From: |
Michael Heerdegen |
Subject: |
[elpa] master eae4541: [el-search] Add accessible buffer area to a validity check |
Date: |
Wed, 13 Feb 2019 13:16:14 -0500 (EST) |
branch: master
commit eae4541cf820bab52d1577f6deb7c894f28ebe38
Author: Michael Heerdegen <address@hidden>
Commit: Michael Heerdegen <address@hidden>
[el-search] Add accessible buffer area to a validity check
Add (POINT-MIN POINT-MAX) to the 'el-search--buffer-match-count-data'
validity checks to ensure that the count data is dismissed when
narrowing has changed.
* packages/el-search/el-search.el
(el-search--buffer-match-count-data): Update docstring.
(el-search-display-match-count): Change to make
'el-search--buffer-match-count-data' support that additional check.
---
packages/el-search/el-search.el | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/packages/el-search/el-search.el b/packages/el-search/el-search.el
index db039de..2a389e1 100644
--- a/packages/el-search/el-search.el
+++ b/packages/el-search/el-search.el
@@ -2475,12 +2475,10 @@ absolute name must be matched by all of them."
"Holds information for displaying a match count.
The value is a list of elements
- \(SEARCH BUFFER-CHARS-MOD-TICK BUFFER-MATCHES\)
+ \(SEARCH BUFFER-CHARS-MOD-TICK (POINT-MIN POINT-MAX) MATCHES\)
-BUFFER-MATCHES is a stream of matches in this buffer. SEARCH is
-the active search and BUFFER-CHARS-MOD-TICK the return value of
-`buffer-chars-modified-tick' from when this stream had been
-created.")
+MATCHES is a stream of matches in this buffer. The other values
+are used to check validity.")
(defun el-search-display-match-count ()
"Display an x/y-style match count in the echo area."
@@ -2489,7 +2487,9 @@ created.")
;; Check whether cached stream of buffer matches is still valid
(pcase el-search--buffer-match-count-data
- (`(,(pred (eq el-search--current-search)) ,(pred (eq
(buffer-chars-modified-tick))) . ,_))
+ (`(,(pred (eq el-search--current-search))
+ ,(pred (eq (buffer-chars-modified-tick)))
+ (,(pred (eq (point-min))) ,(pred (eq (point-max)))) . ,_))
(_
;; (message "Refreshing match count data") (sit-for 1)
(redisplay) ;don't delay highlighting
@@ -2504,13 +2504,14 @@ created.")
(list
el-search--current-search
(buffer-chars-modified-tick)
+ `(,(point-min) ,(point-max))
stream-of-buffer-matches)))))
(let ((pos-here (point)) (matches-<=-here 1) total-matches
(defun-bounds (or (el-search--bounds-of-defun) (cons (point)
(point))))
(matches-<=-here-in-defun 1) (total-matches-in-defun 0)
(largest-match-start-not-after-pos-here nil))
- (pcase-let ((`(,_ ,_ ,matches) el-search--buffer-match-count-data))
+ (pcase-let ((`(,_ ,_ ,_ ,matches) el-search--buffer-match-count-data))
(setq total-matches (let ((inhibit-message t)) (seq-length matches)))
(while (and (not (stream-empty-p matches)) (< (stream-first matches)
(cdr defun-bounds)))
(when (<= (stream-first matches) pos-here)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [elpa] master eae4541: [el-search] Add accessible buffer area to a validity check,
Michael Heerdegen <=