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

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

[elpa] externals/corfu 1562e90 2/4: Reset selected candidate in corfu--u


From: ELPA Syncer
Subject: [elpa] externals/corfu 1562e90 2/4: Reset selected candidate in corfu--update-candidates
Date: Sun, 14 Nov 2021 05:57:16 -0500 (EST)

branch: externals/corfu
commit 1562e902b649d6a529fb6a8edb89fd9f1527b871
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    Reset selected candidate in corfu--update-candidates
---
 corfu.el | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/corfu.el b/corfu.el
index 3edb457..d51ca69 100644
--- a/corfu.el
+++ b/corfu.el
@@ -576,6 +576,7 @@ A scroll bar is displayed from LO to LO+BAR."
            corfu--candidates candidates
            corfu--base base
            corfu--total total
+           corfu--index -1
            corfu--highlight hl
            corfu--metadata metadata))))
 
@@ -768,10 +769,10 @@ A scroll bar is displayed from LO to LO+BAR."
 (defun corfu--pre-command ()
   "Insert selected candidate unless command is marked to continue completion."
   (add-hook 'window-configuration-change-hook #'corfu-quit)
-  (unless (corfu--match-symbol-p corfu-continue-commands this-command)
-    (if (and corfu-commit-predicate (funcall corfu-commit-predicate))
-        (corfu--insert 'exact)
-      (setq corfu--index -1))))
+  (when (and corfu-commit-predicate
+             (not (corfu--match-symbol-p corfu-continue-commands this-command))
+             (funcall corfu-commit-predicate))
+    (corfu--insert 'exact)))
 
 (defun corfu-candidate-previewed-p ()
   "Return t if a candidate is selected and previewed."



reply via email to

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