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

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

[elpa] externals/ivy-hydra 06886f1 055/395: ivy.el (ivy--tramp-prefix-p)


From: Basil L. Contovounesios
Subject: [elpa] externals/ivy-hydra 06886f1 055/395: ivy.el (ivy--tramp-prefix-p): Extract
Date: Thu, 25 Feb 2021 08:31:30 -0500 (EST)

branch: externals/ivy-hydra
commit 06886f104eb0b459b79696fdc376e3e9618c4d7b
Author: Oleh Krehel <ohwoeowho@gmail.com>
Commit: Oleh Krehel <ohwoeowho@gmail.com>

    ivy.el (ivy--tramp-prefix-p): Extract
    
    Re #2335
---
 ivy.el | 27 +++++++++++++++------------
 1 file changed, 15 insertions(+), 12 deletions(-)

diff --git a/ivy.el b/ivy.el
index a696887..40b0241 100644
--- a/ivy.el
+++ b/ivy.el
@@ -1027,18 +1027,7 @@ contains a single candidate.")
                 (string-match-p "\\`[^/]+:.*:.*\\'" ivy-text))
            (string-match-p "\\`/[^/]+:.*:.*\\'" ivy-text))
        (ivy-done))
-      ((or (and (equal ivy--directory "/")
-                (cond ((string-match
-                        "\\`\\([^/]+?\\):\\(?:\\(.*\\)@\\)?\\(.*\\)\\'"
-                        ivy-text)
-                       (setq ivy-text (ivy-state-current ivy-last)))
-                      ((string-match
-                        "\\`\\([^/]+?\\):\\(?:\\(.*\\)@\\)?\\(.*\\)\\'"
-                        (ivy-state-current ivy-last))
-                       (setq ivy-text (ivy-state-current ivy-last)))))
-           (string-match
-            "\\`/\\([^/]+?\\):\\(?:\\(.*\\)@\\)?\\(.*\\)\\'"
-            ivy-text))
+      ((ivy--tramp-prefix-p)
        (let ((method (match-string 1 ivy-text))
              (user (match-string 2 ivy-text))
              (rest (match-string 3 ivy-text))
@@ -1063,6 +1052,20 @@ contains a single candidate.")
       (t
        (ivy-done)))))
 
+(defun ivy--tramp-prefix-p ()
+  (or (and (equal ivy--directory "/")
+           (cond ((string-match
+                   "\\`\\([^/]+?\\):\\(?:\\(.*\\)@\\)?\\(.*\\)\\'"
+                   ivy-text)
+                  (setq ivy-text (ivy-state-current ivy-last)))
+                 ((string-match
+                   "\\`\\([^/]+?\\):\\(?:\\(.*\\)@\\)?\\(.*\\)\\'"
+                   (ivy-state-current ivy-last))
+                  (setq ivy-text (ivy-state-current ivy-last)))))
+      (string-match
+       "\\`/\\([^/]+?\\):\\(?:\\(.*\\)@\\)?\\(.*\\)\\'"
+       ivy-text)))
+
 (defun ivy-expand-file-if-directory (file-name)
   "Expand FILE-NAME as directory.
 When this directory doesn't exist, return nil."



reply via email to

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