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

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

[elpa] master 6263d04 193/399: counsel.el (counsel-find-file): Improve m


From: Oleh Krehel
Subject: [elpa] master 6263d04 193/399: counsel.el (counsel-find-file): Improve mkdir action with ivy-call
Date: Sat, 20 Jul 2019 14:57:21 -0400 (EDT)

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

    counsel.el (counsel-find-file): Improve mkdir action with ivy-call
    
    Make ivy-call cd into created directory.
---
 counsel.el | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/counsel.el b/counsel.el
index a963ca2..e6dd8d7 100644
--- a/counsel.el
+++ b/counsel.el
@@ -1774,7 +1774,12 @@ choose between `yes-or-no-p' and `y-or-n-p'; otherwise 
default to
             :caller 'counsel-find-file-move))
 
 (defun counsel-find-file-mkdir-action (_x)
-  (make-directory (expand-file-name ivy-text ivy--directory)))
+  "Create a directory from `ivy-text'."
+  (let ((dir (expand-file-name ivy-text ivy--directory))
+        (win (and (not (eq ivy-exit 'done))
+                  (active-minibuffer-window))))
+    (make-directory dir)
+    (when win (with-selected-window win (ivy--cd dir)))))
 
 (ivy-set-actions
  'counsel-find-file



reply via email to

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