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

    ivy.el (ivy--magic-file-slash): Change priority in cond
    
    Move two branches around. It may happen that `ivy-text' exists in
    `default-directory' but not in `ivy--directory'.
    
    Maybe (setq default-directory ivy--directory) is appropriate?
    
    Fixes #955
---
 ivy.el | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/ivy.el b/ivy.el
index cf35405..f73ebb2 100644
--- a/ivy.el
+++ b/ivy.el
@@ -2302,10 +2302,6 @@ If SUBEXP is nil, the text properties are applied to the 
whole match."
          (let ((drive-root (match-string 0 ivy-text)))
            (when (file-exists-p drive-root)
              (ivy--cd drive-root))))
-        ((and (file-exists-p ivy-text)
-              (not (string= ivy-text "/"))
-              (file-directory-p ivy-text))
-         (ivy--cd ivy-text))
         ((and (or (> ivy--index 0)
                   (= ivy--length 1)
                   (not (string= ivy-text "/")))
@@ -2315,7 +2311,11 @@ If SUBEXP is nil, the text properties are applied to the 
whole match."
                  (file-directory-p (ivy-state-current ivy-last))
                  (file-exists-p (ivy-state-current ivy-last)))))
          (ivy--cd
-          (expand-file-name (ivy-state-current ivy-last) ivy--directory)))))
+          (expand-file-name (ivy-state-current ivy-last) ivy--directory)))
+        ((and (file-exists-p ivy-text)
+              (not (string= ivy-text "/"))
+              (file-directory-p ivy-text))
+         (ivy--cd ivy-text))))
 
 (defcustom ivy-magic-tilde t
   "When non-nil, ~ will move home when selecting files.

Reply via email to