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

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

[elpa] externals/vertico 18fae58 1/6: Fix #4 - Select prompt if `test-co


From: Protesilaos Stavrou
Subject: [elpa] externals/vertico 18fae58 1/6: Fix #4 - Select prompt if `test-completion` succeeds for the input
Date: Thu, 8 Apr 2021 11:54:23 -0400 (EDT)

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

    Fix #4 - Select prompt if `test-completion` succeeds for the input
    
    Thanks go to @protesilaos for the report and to @oantolin for convincing me 
that
    the exiting behavior can be improved.
---
 vertico.el | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/vertico.el b/vertico.el
index 8f2c45e..0f47f8e 100644
--- a/vertico.el
+++ b/vertico.el
@@ -280,9 +280,15 @@
                            (>= vertico--index 0)
                            (nth vertico--index vertico--candidates)))
                  (idx (seq-position candidates old)))
+           ;; Update index, when kept candidate is found in new candidates 
list.
            (setq vertico--index idx)
+         ;; Otherwise select the prompt for matching inputs or missing 
candidates.
          (setq vertico--keep nil
-               vertico--index (if candidates 0 -1))))
+               vertico--index
+               (if (or (not candidates)
+                       (test-completion input minibuffer-completion-table
+                                        minibuffer-completion-predicate))
+                   -1 0))))
      (setq vertico--base base
            vertico--input input
            vertico--total total



reply via email to

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