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

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

[elpa] externals/vertico 406f8b8 44/48: vertico-insert: Insert only if a


From: Stefan Monnier
Subject: [elpa] externals/vertico 406f8b8 44/48: vertico-insert: Insert only if a candidate is selected
Date: Mon, 5 Apr 2021 10:54:47 -0400 (EDT)

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

    vertico-insert: Insert only if a candidate is selected
    
    This keeps the undo information intact.
---
 vertico.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/vertico.el b/vertico.el
index c7ebaba..4d071e4 100644
--- a/vertico.el
+++ b/vertico.el
@@ -460,7 +460,7 @@
 (defun vertico-insert ()
   "Insert current candidate in minibuffer."
   (interactive)
-  (let ((cand (vertico--candidate)))
+  (when-let (cand (and (>= vertico--index 0) (vertico--candidate)))
     (delete-minibuffer-contents)
     (insert cand)))
 



reply via email to

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