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

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

[elpa] master 581d8c0 66/90: Don't cut off "/ssh:foo" input


From: Oleh Krehel
Subject: [elpa] master 581d8c0 66/90: Don't cut off "/ssh:foo" input
Date: Tue, 30 Jun 2015 07:29:04 +0000

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

    Don't cut off "/ssh:foo" input
    
    * ivy.el (ivy-alt-done): With the example input, offer a completion for
      known remotes with the initial input "foo".
    
    Re #145
---
 ivy.el |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/ivy.el b/ivy.el
index b105690..a96a4c7 100644
--- a/ivy.el
+++ b/ivy.el
@@ -295,9 +295,10 @@ When ARG is t, exit with current text, ignoring the 
candidates."
                                        (expand-file-name x ivy--directory)
                                        "Top"))))
                (ivy-done)))
-            ((and ivy--directory (string-match 
"\\`/\\([^/]+?\\):\\(?:\\(.*\\)@\\)?" ivy-text))
+            ((and ivy--directory (string-match 
"\\`/\\([^/]+?\\):\\(?:\\(.*\\)@\\)?\\(.*\\)\\'" ivy-text))
              (let ((method (match-string 1 ivy-text))
                    (user (match-string 2 ivy-text))
+                   (rest (match-string 3 ivy-text))
                    res)
                (require 'tramp)
                (dolist (x (tramp-get-completion-function method))
@@ -309,7 +310,8 @@ When ARG is t, exit with current text, ignoring the 
candidates."
                (setq res (cl-delete-duplicates res :test #'equal))
                (let ((old-ivy-last ivy-last)
                      (host (ivy-read "Find File: "
-                                     (mapcar #'ivy-build-tramp-name res))))
+                                     (mapcar #'ivy-build-tramp-name res)
+                                     :initial-input rest)))
                  (setq ivy-last old-ivy-last)
                  (when host
                    (setq ivy--directory "/")



reply via email to

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