branch: master
commit 6afce97543ec031a0f1fb3aea6fb9caa02cac055
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>
counsel.el (counsel-git-grep-query-replace): Should exit minibuffer
---
counsel.el | 27 ++++++++++++++-------------
1 files changed, 14 insertions(+), 13 deletions(-)
diff --git a/counsel.el b/counsel.el
index 0e3010e..dee0e59 100644
--- a/counsel.el
+++ b/counsel.el
@@ -391,19 +391,20 @@
(let* ((enable-recursive-minibuffers t)
(from (ivy--regex ivy-text))
(to (query-replace-read-to from "Query replace" t)))
- (let (done-buffers)
- (dolist (cand ivy--old-cands)
- (when (string-match "\\`\\(.*?\\):\\([0-9]+\\):\\(.*\\)\\'" cand)
- (with-ivy-window
- (let ((file-name (match-string-no-properties 1 cand)))
- (setq file-name (expand-file-name file-name
counsel--git-grep-dir))
- (unless (member file-name done-buffers)
- (push file-name done-buffers)
- (find-file file-name)
- (goto-char (point-min)))
- (perform-replace from to t t nil))))))
- (delete-minibuffer-contents)
- (swiper--cleanup)
+ (ivy-set-action
+ (lambda (_)
+ (let (done-buffers)
+ (dolist (cand ivy--old-cands)
+ (when (string-match "\\`\\(.*?\\):\\([0-9]+\\):\\(.*\\)\\'" cand)
+ (with-ivy-window
+ (let ((file-name (match-string-no-properties 1 cand)))
+ (setq file-name (expand-file-name file-name
counsel--git-grep-dir))
+ (unless (member file-name done-buffers)
+ (push file-name done-buffers)
+ (find-file file-name)
+ (goto-char (point-min)))
+ (perform-replace from to t t nil))))))))
+ (setq ivy-exit 'done)
(exit-minibuffer))))
(defun counsel-git-grep-recenter ()