emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master b2d2b82 209/272: counsel.el (counsel-grep-action): Improve


From: Oleh Krehel
Subject: [elpa] master b2d2b82 209/272: counsel.el (counsel-grep-action): Improve cleanup
Date: Mon, 25 Apr 2016 10:13:26 +0000

branch: master
commit b2d2b822cf4034e09c0c8a7ae02730347486786c
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>

    counsel.el (counsel-grep-action): Improve cleanup
    
    When the current input goes from matching to non-matching, ensure that
    the old overlays are cleaned up.
---
 counsel.el |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/counsel.el b/counsel.el
index e9b706b..9384262 100644
--- a/counsel.el
+++ b/counsel.el
@@ -1361,8 +1361,9 @@ This uses `counsel-ag' with `counsel-pt-base-command' 
replacing
       nil)))
 
 (defun counsel-grep-action (x)
-  (when (string-match "\\`\\([0-9]+\\):\\(.*\\)\\'" x)
-    (with-ivy-window
+  (with-ivy-window
+    (swiper--cleanup)
+    (when (string-match "\\`\\([0-9]+\\):\\(.*\\)\\'" x)
       (let ((file-name counsel--git-grep-dir)
             (line-number (match-string-no-properties 1 x)))
         (find-file file-name)
@@ -1372,7 +1373,6 @@ This uses `counsel-ag' with `counsel-pt-base-command' 
replacing
         (if (eq ivy-exit 'done)
             (swiper--ensure-visible)
           (unless (eq ivy-exit 'done)
-            (swiper--cleanup)
             (isearch-range-invisible (line-beginning-position)
                                      (line-end-position))
             (swiper--add-overlays (ivy--regex ivy-text))))))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]