branch: elpa/helm
commit 406a9048b0010cc22e1c7bcd7f3163d5b86f01a9
Author: Thierry Volpiatto <thie...@posteo.net>
Commit: Thierry Volpiatto <thie...@posteo.net>

    Simplify CRM insert completion (emacs bug 76461)
---
 helm-mode.el | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/helm-mode.el b/helm-mode.el
index 8a9181867a..05c91ca02f 100644
--- a/helm-mode.el
+++ b/helm-mode.el
@@ -2911,8 +2911,10 @@ Be sure to know what you are doing when modifying this.")
 (defun helm--crm-insert-fn (_start _end choice)
   ;; Fix Emacs bug~76461.
   (let* ((beg (save-excursion
-                (if (re-search-backward crm-separator nil t)
-                    (if (field-at-pos (point)) (field-end) (1+ (point)))
+                (if (and (re-search-backward crm-separator nil t)
+                         ;; Matches end of prompt (:) when sep is ":".
+                         (not (field-at-pos (point))))
+                    (1+ (point))
                   (minibuffer-prompt-end))))
          (end (save-excursion
                 (if (re-search-forward crm-separator nil t)

Reply via email to