aboutsummaryrefslogtreecommitdiff
path: root/evil-search.el
diff options
context:
space:
mode:
authorEivind Fonn <evfonn@gmail.com>2019-12-28 11:41:26 +0100
committerEivind Fonn <evfonn@gmail.com>2019-12-28 11:46:33 +0100
commit901c3e35ff62e299efbdb6a212541d38a332ddae (patch)
treea9b009586d84e3fb3657f207dd9286608ddf2d2a /evil-search.el
parentd8ca23db61e813ebe0690f07de9b3839134f3ebf (diff)
Search highlights: check window liveness
Diffstat (limited to 'evil-search.el')
-rw-r--r--evil-search.el13
1 files changed, 7 insertions, 6 deletions
diff --git a/evil-search.el b/evil-search.el
index 58b6023..51ac361 100644
--- a/evil-search.el
+++ b/evil-search.el
@@ -610,12 +610,13 @@ The following properties are supported:
'all-windows)
(get-buffer-window-list (current-buffer) nil t)
(list (evil-ex-hl-window hl))))
- (let ((beg (max (window-start win)
- (or (evil-ex-hl-min hl) (point-min))))
- (end (min (window-end win)
- (or (evil-ex-hl-max hl) (point-max)))))
- (when (< beg end)
- (push (cons beg end) ranges))))
+ (when (window-live-p win)
+ (let ((beg (max (window-start win)
+ (or (evil-ex-hl-min hl) (point-min))))
+ (end (min (window-end win)
+ (or (evil-ex-hl-max hl) (point-max)))))
+ (when (< beg end)
+ (push (cons beg end) ranges)))))
(setq ranges
(sort ranges #'(lambda (r1 r2) (< (car r1) (car r2)))))
(while ranges