]> code.delx.au - gnu-emacs-elpa/commitdiff
ivy.el (ivy-alt-done): Treat `ivy-text' with ":" verbatim
authorOleh Krehel <ohwoeowho@gmail.com>
Tue, 28 Apr 2015 09:06:09 +0000 (11:06 +0200)
committerOleh Krehel <ohwoeowho@gmail.com>
Tue, 28 Apr 2015 09:06:09 +0000 (11:06 +0200)
* ivy.el (ivy-alt-done): Should work better now for ssh: stuff.

It should be possible to type in any directory: `/ssh:user@domain.com:`
<kbd>C-j</kbd> and get completion.

Re #59

ivy.el

diff --git a/ivy.el b/ivy.el
index eea4016b79bc544342f2409938fcdd02ccce7f2c..a696d5b1bcbf79e140f285ed41eda81acb73527c 100644 (file)
--- a/ivy.el
+++ b/ivy.el
@@ -228,11 +228,15 @@ When ARG is t, exit with current text, ignoring the candidates."
       (ivy-immediate-done)
     (let (dir)
       (if (and ivy--directory
-               (not (string= ivy--current "./"))
-               (cl-plusp ivy--length)
-               (file-directory-p
-                (setq dir (expand-file-name
-                           ivy--current ivy--directory))))
+               (or
+                (and
+                 (not (string= ivy--current "./"))
+                 (cl-plusp ivy--length)
+                 (file-directory-p
+                  (setq dir (expand-file-name
+                             ivy--current ivy--directory))))
+                (prog1 (string-match ":" ivy-text)
+                  (setq dir ivy-text))))
           (progn
             (ivy--cd dir)
             (ivy--exhibit))