branch: master
commit 118431c78a02d3d8cb6a355d6727d9ff665b9b24
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>

    ivy.el (ivy--insert-prompt): Don't require prompt to end in ": "
    
    Fixes #1207
---
 ivy.el | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/ivy.el b/ivy.el
index 3fadae6..13d8b32 100644
--- a/ivy.el
+++ b/ivy.el
@@ -2394,12 +2394,12 @@ STD-PROPS is a property list containing the default 
text properties."
                                  counsel-find-symbol))
       (setq ivy--prompt-extra ""))
     (let (head tail)
-      (if (string-match "\\(.*\\): \\'" ivy--prompt)
+      (if (string-match "\\(.*?\\)\\(:? ?\\)\\'" ivy--prompt)
           (progn
             (setq head (match-string 1 ivy--prompt))
-            (setq tail ": "))
-        (setq head (substring ivy--prompt 0 -1))
-        (setq tail " "))
+            (setq tail (match-string 2 ivy--prompt)))
+        (setq head ivy--prompt)
+        (setq tail ""))
       (let ((inhibit-read-only t)
             (std-props '(front-sticky t rear-nonsticky t field t read-only t))
             (n-str

Reply via email to