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

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

[elpa] externals/vertico 6d0963c 1/6: Work around `completion-boundaries


From: Protesilaos Stavrou
Subject: [elpa] externals/vertico 6d0963c 1/6: Work around `completion-boundaries' bug in Emacs 27.1
Date: Sat, 10 Apr 2021 05:55:00 -0400 (EDT)

branch: externals/vertico
commit 6d0963c6abeaa3520500bddfd24ce932cbc627a6
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    Work around `completion-boundaries' bug in Emacs 27.1
    
    See https://github.com/minad/marginalia/issues/67
---
 vertico.el | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/vertico.el b/vertico.el
index 6df65fc..7d38ca7 100644
--- a/vertico.el
+++ b/vertico.el
@@ -404,10 +404,17 @@
   (let* ((metadata (completion--field-metadata (minibuffer-prompt-end)))
          (content (minibuffer-contents-no-properties))
          (pt (- (point) (minibuffer-prompt-end)))
-         (bounds (completion-boundaries (substring content 0 pt)
-                                        minibuffer-completion-table
-                                        minibuffer-completion-predicate
-                                        (substring content pt))))
+         (before (substring content 0 pt))
+         (after (substring content pt))
+         ;; BUG: `completion-boundaries` fails for `partial-completion`
+         ;; if the cursor is moved between the slashes of "~//".
+         ;; See also marginalia.el
+         (bounds (or (condition-case nil
+                         (completion-boundaries before
+                                                minibuffer-completion-table
+                                                minibuffer-completion-predicate
+                                                after)
+                       (t (cons 0 (length after)))))))
     (unless (equal vertico--input (cons content bounds))
       (vertico--update-candidates content bounds metadata))
     (vertico--display-candidates (vertico--format-candidates content bounds 
metadata))



reply via email to

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