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

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

[elpa] master 2c8ad2a 70/90: Add support for Windows drive letters


From: Oleh Krehel
Subject: [elpa] master 2c8ad2a 70/90: Add support for Windows drive letters
Date: Tue, 30 Jun 2015 07:29:13 +0000

branch: master
commit 2c8ad2a76b956096b5cf61a7aeb0ab04f79cad89
Author: Greg Lucas <address@hidden>
Commit: Greg Lucas <address@hidden>

    Add support for Windows drive letters
---
 ivy.el |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/ivy.el b/ivy.el
index 58d57ea..d0e0573 100644
--- a/ivy.el
+++ b/ivy.el
@@ -1150,7 +1150,14 @@ Should be run via minibuffer `post-command-hook'."
                (if (member ivy-text ivy--all-candidates)
                    (ivy--cd (expand-file-name ivy-text ivy--directory))
                  (when (string-match "//\\'" ivy-text)
-                   (ivy--cd "/")))
+                  (if (and default-directory
+                           (string-match "[[:alpha:]]:/" default-directory))
+                      (ivy--cd (match-string 0 default-directory))
+                    (ivy--cd "/")))
+                (when (string-match "[[:alpha:]]:/" ivy-text)
+                  (let ((drive-root (match-string 0 ivy-text)))
+                    (when (file-exists-p drive-root)
+                      (ivy--cd drive-root)))))
              (if (string-match "~\\'" ivy-text)
                  (ivy--cd (expand-file-name "~/")))))
           ((eq (ivy-state-collection ivy-last) 'internal-complete-buffer)



reply via email to

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