[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 773ac65 245/399: swiper.el (swiper--cleanup): Re-use lazy-
From: |
Oleh Krehel |
Subject: |
[elpa] master 773ac65 245/399: swiper.el (swiper--cleanup): Re-use lazy-highlight-cleanup |
Date: |
Sat, 20 Jul 2019 14:57:33 -0400 (EDT) |
branch: master
commit 773ac65ad73ea3207b4df93e098943ded5e330d2
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
swiper.el (swiper--cleanup): Re-use lazy-highlight-cleanup
Fixes #2064
---
swiper.el | 37 ++++++++++++++++++++++---------------
1 file changed, 22 insertions(+), 15 deletions(-)
diff --git a/swiper.el b/swiper.el
index 1db13b1..1e92c79 100644
--- a/swiper.el
+++ b/swiper.el
@@ -639,6 +639,7 @@ When capture groups are present in the input, print them
instead of lines."
(when (setq swiper--reveal-mode
(bound-and-true-p reveal-mode))
(reveal-mode -1))
+ (lazy-highlight-cleanup t)
(when (bound-and-true-p evil-mode)
(evil-set-jump)))
@@ -764,6 +765,9 @@ Matched candidates should have `swiper-invocation-face'."
"Clean up the overlays."
(while swiper--overlays
(delete-overlay (pop swiper--overlays)))
+ ;; force cleanup unless it's :unwind
+ (lazy-highlight-cleanup
+ (if (eq ivy-exit 'done) lazy-highlight-cleanup t))
(save-excursion
(goto-char (point-min))
(isearch-clean-overlays)))
@@ -775,15 +779,15 @@ Matched candidates should have `swiper-invocation-face'."
(overlay-put ov 'face 'ivy-cursor))
(push ov swiper--overlays)))
-(defun swiper--add-overlay (beg end face wnd priority)
- "Add overlay bound by BEG and END to `swiper--overlays'.
+(defun swiper--make-overlay (beg end face wnd priority)
+ "Create an overlay bound by BEG and END.
FACE, WND and PRIORITY are properties corresponding to
the face, window and priority of the overlay."
(let ((overlay (make-overlay beg end)))
- (push overlay swiper--overlays)
(overlay-put overlay 'face face)
(overlay-put overlay 'window wnd)
- (overlay-put overlay 'priority priority)))
+ (overlay-put overlay 'priority priority)
+ overlay))
(defun swiper--recenter-p ()
(or (display-graphic-p)
@@ -865,7 +869,8 @@ WND, when specified is the window."
(end-of-visual-line)
(point))
(1+ (line-end-position)))))
- (swiper--add-overlay beg end 'swiper-line-face wnd 0))
+ (push (swiper--make-overlay beg end 'swiper-line-face wnd 0)
+ swiper--overlays))
(let* ((pt (point))
(wh (window-height))
(beg (or beg (save-excursion
@@ -901,11 +906,12 @@ WND, when specified is the window."
(let ((mb (match-beginning 0))
(me (match-end 0)))
(unless (> (- me mb) 2017)
- (swiper--add-overlay mb me
- (if (zerop ivy--subexps)
- (cadr faces)
- (car faces))
- wnd 0))))
+ (push (swiper--make-overlay mb me
+ (if (zerop ivy--subexps)
+ (cadr faces)
+ (car faces))
+ wnd 0)
+ isearch-lazy-highlight-overlays))))
(let ((i 1)
(j 0))
(while (<= (cl-incf j) ivy--subexps)
@@ -917,11 +923,12 @@ WND, when specified is the window."
(integerp (match-beginning (+ j 1)))
(= em (match-beginning (+ j 1))))
(setq em (match-end (cl-incf j))))
- (swiper--add-overlay
- bm em
- (nth (1+ (mod (+ i 2) (1- (length faces))))
- faces)
- wnd i)
+ (push (swiper--make-overlay
+ bm em
+ (nth (1+ (mod (+ i 2) (1- (length faces))))
+ faces)
+ wnd i)
+ isearch-lazy-highlight-overlays)
(cl-incf i))))))))))))
(defcustom swiper-action-recenter nil
- [elpa] master eee9716 236/399: Add open in dired action to counsel-file-jump, (continued)
- [elpa] master eee9716 236/399: Add open in dired action to counsel-file-jump, Oleh Krehel, 2019/07/20
- [elpa] master fb64ea3 237/399: swiper.el (swiper-mc): Works for swiper-isearch, Oleh Krehel, 2019/07/20
- [elpa] master 39a9e94 232/399: swiper.el (swiper-isearch-current-match): Add, Oleh Krehel, 2019/07/20
- [elpa] master b7574fe 234/399: swiper.el: Extra condition to recenter in terminal, Oleh Krehel, 2019/07/20
- [elpa] master 10755b2 239/399: swiper.el (swiper-isearch-toggle): Add, Oleh Krehel, 2019/07/20
- [elpa] master 38f8e45 242/399: swiper.el (swiper-isearch-toggle): Fix candidate jump in toggle, Oleh Krehel, 2019/07/20
- [elpa] master d9d6064 241/399: ivy.el (ivy-completion-in-region-action): Obey :exit-function, Oleh Krehel, 2019/07/20
- [elpa] master 6075a73 243/399: swiper.el (swiper--add-overlays): Reuse swiper--add-overlay, Oleh Krehel, 2019/07/20
- [elpa] master 687aae2 246/399: swiper.el (swiper-query-replace): Check for empty input, Oleh Krehel, 2019/07/20
- [elpa] master 8df253a 249/399: swiper.el (swiper--isearch-same-line-p): Add, Oleh Krehel, 2019/07/20
- [elpa] master 773ac65 245/399: swiper.el (swiper--cleanup): Re-use lazy-highlight-cleanup,
Oleh Krehel <=
- [elpa] master 815f094 252/399: swiper.el (swiper--add-line-overlay): Extract, Oleh Krehel, 2019/07/20
- [elpa] master eb1e636 253/399: swiper.el (swiper--add-cursor-overlay): Display only in current window, Oleh Krehel, 2019/07/20
- [elpa] master 7dc1445 256/399: swiper.el (swiper-isearch): Use the same faces in the minibuffer, Oleh Krehel, 2019/07/20
- [elpa] master 4d40f88 255/399: swiper.el (swiper--isearch-function): Speedup for big files, Oleh Krehel, 2019/07/20
- [elpa] master 2ce81eb 240/399: swiper.el (swiper-isearch-toggle): Extend doc, Oleh Krehel, 2019/07/20
- [elpa] master cc92e1c 238/399: swiper.el (swiper--avy-goto): Handle quit, Oleh Krehel, 2019/07/20
- [elpa] master e6f49c2 244/399: swiper.el: Reorder by swiper--overlays, Oleh Krehel, 2019/07/20
- [elpa] master e04b10c 248/399: swiper.el (swiper-isearch-function): Refactor, Oleh Krehel, 2019/07/20
- [elpa] master ee71733 247/399: ivy.el (ivy-switch-buffer-other-window): Fix ivy-use-virtual-buffers, Oleh Krehel, 2019/07/20
- [elpa] master b05ae24 254/399: swiper.el (swiper--add-properties): Extract, Oleh Krehel, 2019/07/20