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

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

[elpa] externals/corfu de16e84 1/2: Reset corfu--auto-start after a cand


From: ELPA Syncer
Subject: [elpa] externals/corfu de16e84 1/2: Reset corfu--auto-start after a candidate has been selected
Date: Thu, 22 Jul 2021 10:57:11 -0400 (EDT)

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

    Reset corfu--auto-start after a candidate has been selected
---
 corfu.el | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/corfu.el b/corfu.el
index c496287..7d8cf1e 100644
--- a/corfu.el
+++ b/corfu.el
@@ -645,6 +645,8 @@ completion began less than that number of seconds ago."
       (corfu--done str 'finished)
       nil)
      ((not (or corfu--candidates                      ;; 4) There are no 
candidates
+               ;; When `corfu-quit-no-match' is a number of seconds and the 
auto completion wasn't
+               ;; initiated too long ago, quit directly without showing the 
"No match" popup.
                (if (and corfu--auto-start (numberp corfu-quit-no-match))
                    (< (- (float-time) corfu--auto-start) corfu-quit-no-match)
                  (eq t corfu-quit-no-match))))
@@ -672,7 +674,9 @@ completion began less than that number of seconds ago."
 
 (defun corfu--goto (index)
   "Go to candidate with INDEX."
-  (setq corfu--index (max -1 (min index (1- corfu--total)))))
+  (setq corfu--index (max -1 (min index (1- corfu--total)))
+        ;; Reset auto start in order to disable the `corfu-quit-no-match' timer
+        corfu--auto-start nil))
 
 (defun corfu-next ()
   "Go to next candidate."



reply via email to

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