[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/vertico 5e5192f 2/6: Improve prompt selection
From: |
Protesilaos Stavrou |
Subject: |
[elpa] externals/vertico 5e5192f 2/6: Improve prompt selection |
Date: |
Thu, 8 Apr 2021 11:54:23 -0400 (EDT) |
branch: externals/vertico
commit 5e5192fbcbee314e056f2db356aedd9f6187db0c
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
Improve prompt selection
Do not select the prompt if the first candidate equals the input after the
completion boundary. This avoids jumping between candidate and prompt. A
candidate matching the input after the completion boundary will always be
moved
first. This is a refinement of the previous commit, see #4. It is getting a
bit
complicated unfortunately. Thank you for talking me into this, @oantolin...
---
vertico.el | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/vertico.el b/vertico.el
index 0f47f8e..6aba323 100644
--- a/vertico.el
+++ b/vertico.el
@@ -282,12 +282,14 @@
(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.
+ ;; Otherwise select the prompt for missing candidates or matching
inputs,
+ ;; except if the input matches the first candidate.
(setq vertico--keep nil
vertico--index
(if (or (not candidates)
- (test-completion input minibuffer-completion-table
- minibuffer-completion-predicate))
+ (and (not (equal (vertico--input-after-boundary input)
(car candidates)))
+ (test-completion input minibuffer-completion-table
+ minibuffer-completion-predicate)))
-1 0))))
(setq vertico--base base
vertico--input input
- [elpa] externals/vertico updated (82ed224 -> 1fc43bb), Protesilaos Stavrou, 2021/04/08
- [elpa] externals/vertico 18fae58 1/6: Fix #4 - Select prompt if `test-completion` succeeds for the input, Protesilaos Stavrou, 2021/04/08
- [elpa] externals/vertico b94e577 3/6: Truncate multi line candidates to a single line, Protesilaos Stavrou, 2021/04/08
- [elpa] externals/vertico 1fc43bb 6/6: Version 0.2, Protesilaos Stavrou, 2021/04/08
- [elpa] externals/vertico 5e5192f 2/6: Improve prompt selection,
Protesilaos Stavrou <=
- [elpa] externals/vertico 24fab0b 5/6: Avoid window resizing - ensure that we never show more than 10 lines, Protesilaos Stavrou, 2021/04/08
- [elpa] externals/vertico c9a28d1 4/6: Minor simplifications, Protesilaos Stavrou, 2021/04/08