From: Oleh Krehel Date: Sat, 26 Mar 2016 13:26:22 +0000 (+0100) Subject: counsel.el (counsel-grep-action): Reveal outlines X-Git-Url: https://code.delx.au/gnu-emacs-elpa/commitdiff_plain/6a8da3919bd7265fbcf506eaf66f14bde2b2600f counsel.el (counsel-grep-action): Reveal outlines Just like swiper. --- diff --git a/counsel.el b/counsel.el index ebdca2fd1..5a73bf2c6 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 ()