branch: master
commit ba626e7ec6a4fde8287bbf2ad19404f8cd8933f3
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>
ivy.el (ivy-next-history-element): Use minibuffer-default for
dired-dwim-target
(setq dired-dwim-target t) is a nice productivity boost. Except for
the situation when you want to copy the file to the current directory,
and a different directory is preselected instead.
When this happens, you can now press "M-n" to select the current
directory.
---
ivy.el | 2 ++
1 file changed, 2 insertions(+)
diff --git a/ivy.el b/ivy.el
index 8b9aecf..679b81a 100644
--- a/ivy.el
+++ b/ivy.el
@@ -1411,6 +1411,8 @@ Call the permanent action if possible."
(if (and (= minibuffer-history-position 0)
(equal ivy-text ""))
(progn
+ (when minibuffer-default
+ (setq ivy--default (car minibuffer-default)))
(insert ivy--default)
(when (and (with-ivy-window (derived-mode-p 'prog-mode))
(eq (ivy-state-caller ivy-last) 'swiper)