]> code.delx.au - gnu-emacs-elpa/commitdiff
Allow access to TRAMP from "// C-j"
authorOleh Krehel <ohwoeowho@gmail.com>
Thu, 19 Nov 2015 10:02:38 +0000 (11:02 +0100)
committerOleh Krehel <ohwoeowho@gmail.com>
Thu, 19 Nov 2015 10:02:38 +0000 (11:02 +0100)
* ivy.el (ivy-alt-done): Match not only `ivy-text' but also
  `ivy--current' for TRAMP regex.

Re #285

ivy.el

diff --git a/ivy.el b/ivy.el
index 01baeabd4098e9c847fa520dfbc6103cf85c9fa4..4ba8cff10f7d6059fa7d7268da306c858e1f084d 100644 (file)
--- a/ivy.el
+++ b/ivy.el
@@ -435,9 +435,13 @@ When ARG is t, exit with current text, ignoring the candidates."
            (ivy-done))
           ((and ivy--directory
                 (or (and (equal ivy--directory "/")
-                         (string-match
-                          "\\`\\([^/]+?\\):\\(?:\\(.*\\)@\\)?\\(.*\\)\\'"
-                          ivy-text))
+                         (cond ((string-match
+                                 "\\`\\([^/]+?\\):\\(?:\\(.*\\)@\\)?\\(.*\\)\\'"
+                                 ivy-text))
+                               ((string-match
+                                 "\\`\\([^/]+?\\):\\(?:\\(.*\\)@\\)?\\(.*\\)\\'"
+                                 ivy--current)
+                                (setq ivy-text ivy--current))))
                     (string-match
                      "\\`/\\([^/]+?\\):\\(?:\\(.*\\)@\\)?\\(.*\\)\\'"
                      ivy-text)))