branch: master commit 501ac712dfda5af28e717f0c0b873db025d80385 Author: Oleh Krehel <ohwoeo...@gmail.com> Commit: Oleh Krehel <ohwoeo...@gmail.com>
ivy.el (ivy-occur-revert-buffer): Re-use ivy-highlight-grep-commands --- counsel.el | 3 ++- ivy.el | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/counsel.el b/counsel.el index 7b6aaac..39385f0 100644 --- a/counsel.el +++ b/counsel.el @@ -3109,7 +3109,8 @@ When non-nil, INITIAL-INPUT is the initial search pattern." :unwind-fn #'counsel--grep-unwind :index-fn #'ivy-recompute-index-swiper-async :occur #'counsel-grep-occur - :more-chars 2) + :more-chars 2 + :grep-p t) ;;;###autoload (defun counsel-grep-backward (&optional initial-input) diff --git a/ivy.el b/ivy.el index 8ff3464..21dcf3b 100644 --- a/ivy.el +++ b/ivy.el @@ -3855,7 +3855,7 @@ Note: The usual last two arguments are flipped for convenience.") (str (if (eq ivy-display-style 'fancy) (if (memq (ivy-state-caller ivy-last) ivy-highlight-grep-commands) - (let* ((start (if (string-match "\\`[^:]+:[^:]+:" str) + (let* ((start (if (string-match "\\`[^:]+:\\(?:[^:]+:\\)?" str) (match-end 0) 0)) (file (substring str 0 start)) (match (substring str start))) @@ -4827,7 +4827,7 @@ updated original buffer." (erase-buffer) (funcall (plist-get ivy--occurs-list caller) t) (ivy-occur-grep-mode)))) - ((memq caller '(counsel-git-grep counsel-grep counsel-ag counsel-rg)) + ((memq caller ivy-highlight-grep-commands) (let ((inhibit-read-only t) (line (line-number-at-pos))) (erase-buffer)