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

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

[elpa] externals/vertico fe0eb1e 01/10: Change prompt selection again


From: Protesilaos Stavrou
Subject: [elpa] externals/vertico fe0eb1e 01/10: Change prompt selection again
Date: Fri, 9 Apr 2021 10:48:28 -0400 (EDT)

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

    Change prompt selection again
    
    This is a refinement of 5e5192fbcbee314e056f2db356aedd9f6187db0c. This 
commit
    fixes two issues:
    
    - If you have "~/emacs-pkg/", it selects first the prompt, then you enter
      "~/emacs-pkg/verti" it selects the "vertico/" candidate. Then you finish
      typing "~/emacs-pkg/vertico" and it jumps back to the prompt, since this 
is a
      valid input. I would prefer if it would jump back when I type the 
additional
      slash "~/emacs-pkg/vertico/".
    
    - If you start at "/" and enter "/usr" it selects the prompt and if you now
      press TAB it does not complete to "/usr/" since the "/usr" prompt is still
      valid and in this case vertico-insert does nothing. This breaks tabbing
      through directories.
    
    cc @oantolin
---
 vertico.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/vertico.el b/vertico.el
index fe2b47b..4d8e2bb 100644
--- a/vertico.el
+++ b/vertico.el
@@ -282,12 +282,12 @@
                  (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 missing candidates or matching 
inputs,
-         ;; except if the input matches the first candidate.
+         ;; Otherwise select the prompt for missing candidates or for matching 
inputs,
+         ;; as long as the input after the boundary is empty.
          (setq vertico--keep nil
                vertico--index
                (if (or (not candidates)
-                       (and (not (equal (vertico--input-after-boundary input) 
(car candidates)))
+                       (and (equal (vertico--input-after-boundary input) "")
                             (test-completion input minibuffer-completion-table
                                              minibuffer-completion-predicate)))
                    -1 0))))



reply via email to

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