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

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

[elpa] externals/vertico f8fd271: Bugfix: Only lock the prompt if prompt


From: ELPA Syncer
Subject: [elpa] externals/vertico f8fd271: Bugfix: Only lock the prompt if prompt selection is allowed
Date: Tue, 6 Jul 2021 12:57:16 -0400 (EDT)

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

    Bugfix: Only lock the prompt if prompt selection is allowed
---
 vertico.el | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/vertico.el b/vertico.el
index 9629199..584c7b4 100644
--- a/vertico.el
+++ b/vertico.el
@@ -557,10 +557,11 @@ See `resize-mini-windows' for documentation."
 
 (defun vertico--goto (index)
   "Go to candidate with INDEX."
-  (setq vertico--lock-candidate t
-        vertico--index
-        (max (if (or (vertico--allow-prompt-selection-p) (= 0 vertico--total)) 
-1 0)
-             (min index (1- vertico--total)))))
+  (let ((prompt (vertico--allow-prompt-selection-p)))
+    (setq vertico--index
+          (max (if (or prompt (= 0 vertico--total)) -1 0)
+               (min index (1- vertico--total)))
+          vertico--lock-candidate (or (>= vertico--index 0) prompt))))
 
 (defun vertico-first ()
   "Go to first candidate, or to the prompt when the first candidate is 
selected."



reply via email to

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