branch: master
commit 6a8da3919bd7265fbcf506eaf66f14bde2b2600f
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>
counsel.el (counsel-grep-action): Reveal outlines
Just like swiper.
---
counsel.el | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/counsel.el b/counsel.el
index ebdca2f..5a73bf2 100644
--- a/counsel.el
+++ b/counsel.el
@@ -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 ()