emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master f28e00c 194/399: counsel.el (counsel-find-file): Improve d


From: Oleh Krehel
Subject: [elpa] master f28e00c 194/399: counsel.el (counsel-find-file): Improve delete action with ivy-call
Date: Sat, 20 Jul 2019 14:57:22 -0400 (EDT)

branch: master
commit f28e00c9b436f8f54de0480e97084baeec744b5f
Author: Eric Danan <address@hidden>
Commit: Oleh Krehel <address@hidden>

    counsel.el (counsel-find-file): Improve delete action with ivy-call
    
    Make ivy-call stay in directory and update minibuffer (previously it
    would go back to the initial directory from which counsel-find-file
    was called).
---
 counsel.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/counsel.el b/counsel.el
index e6dd8d7..a7b5343 100644
--- a/counsel.el
+++ b/counsel.el
@@ -1761,7 +1761,9 @@ choose between `yes-or-no-p' and `y-or-n-p'; otherwise 
default to
             (counsel--yes-or-no-p "Delete %s? " x))
     (dired-delete-file x dired-recursive-deletes delete-by-moving-to-trash)
     (dired-clean-up-after-deletion x)
-    (ivy--reset-state ivy-last)))
+    (let ((win (and (not (eq ivy-exit 'done))
+                    (active-minibuffer-window))))
+      (when win (with-selected-window win (ivy--cd ivy--directory))))))
 
 (defun counsel-find-file-move (x)
   "Move or rename file X."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]