]> code.delx.au - gnu-emacs-elpa/commitdiff
counsel.el (counsel-grep-action): Reveal outlines
authorOleh Krehel <ohwoeowho@gmail.com>
Sat, 26 Mar 2016 13:26:22 +0000 (14:26 +0100)
committerOleh Krehel <ohwoeowho@gmail.com>
Sat, 26 Mar 2016 13:26:22 +0000 (14:26 +0100)
Just like swiper.

counsel.el

index ebdca2fd1cd874fa2ac67f11c91590517e032029..5a73bf2c6538f2a2343f8e68ef77c9e21619e011 100644 (file)
@@ -1369,11 +1369,13 @@ This uses `counsel-ag' with `counsel-pt-base-command' replacing
         (goto-char (point-min))
         (forward-line (1- (string-to-number line-number)))
         (re-search-forward (ivy--regex ivy-text t) (line-end-position) t)
-        (unless (eq ivy-exit 'done)
-          (swiper--cleanup)
-          (isearch-range-invisible (line-beginning-position)
-                                   (line-end-position))
-          (swiper--add-overlays (ivy--regex ivy-text)))))))
+        (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))))))))
 
 ;;;###autoload
 (defun counsel-grep ()