branch: master
commit d0904f8e653f13c38be8833d2eb5fcd8dcdf9fe0
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>

    ivy.el: Fix extra initial-input in read-file-name
    
    e.g. `find-name-dired' will now propose "." as the default, instead of
    having both the "." and the full path of the current directory.
---
 ivy.el | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/ivy.el b/ivy.el
index c18caa3..73f7967 100644
--- a/ivy.el
+++ b/ivy.el
@@ -1682,10 +1682,9 @@ This is useful for recursive `ivy-read'."
              (when (and initial-input
                         (not (equal initial-input "")))
                (cond ((file-directory-p initial-input)
-                      (when (and (eq this-command 'dired-do-copy)
-                                 (equal (file-name-nondirectory initial-input)
-                                        ""))
-                        (setf (ivy-state-preselect state) (setq preselect 
nil)))
+                      (when (equal (file-name-nondirectory initial-input) "")
+                        (setf (ivy-state-preselect state) (setq preselect nil))
+                        (setf (ivy-state-def state) (setq def nil)))
                       (setq ivy--directory initial-input)
                       (setq initial-input nil)
                       (when preselect

Reply via email to