[Top][All Lists]

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

[elpa] master fe6d2b1 07/63: Make ffap work again

From: Oleh Krehel
Subject: [elpa] master fe6d2b1 07/63: Make ffap work again
Date: Fri, 21 Aug 2015 12:08:30 +0000

branch: master
commit fe6d2b17326625160a89d71ec6b2244270b66baa
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>

    Make ffap work again
    * ivy.el (ivy--reset-state): When completing files, consider the case
      when the directory of PRESELECT isn't `default-directory'.
    Fixes #165
 ivy.el |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/ivy.el b/ivy.el
index 4bb6278..dfed9f4 100644
--- a/ivy.el
+++ b/ivy.el
@@ -870,6 +870,13 @@ This is useful for recursive `ivy-read'."
             ((eq collection 'read-file-name-internal)
              (setq ivy--directory default-directory)
              (require 'dired)
+             (when preselect
+               (let ((preselect-directory (file-name-directory preselect)))
+                 (unless (string= preselect-directory
+                                  default-directory)
+                   (setq coll (ivy--sorted-files
+                               (setq ivy--directory preselect-directory)))
+                   (setq preselect (file-name-nondirectory preselect)))))
              (setq coll
                    (ivy--sorted-files default-directory))
              (when initial-input

reply via email to

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