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

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

[elpa] externals/corfu edf0cef 1/3: Run :exit-function when quitting wit


From: ELPA Syncer
Subject: [elpa] externals/corfu edf0cef 1/3: Run :exit-function when quitting with exact match
Date: Sun, 21 Nov 2021 12:57:11 -0500 (EST)

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

    Run :exit-function when quitting with exact match
---
 corfu.el | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/corfu.el b/corfu.el
index 9f42145..7130c87 100644
--- a/corfu.el
+++ b/corfu.el
@@ -757,25 +757,25 @@ input. If there hasn't been any input, then quit."
      ((and initializing (not corfu--candidates))
       (funcall msg "No match")
       (corfu-quit))
-     ;; 2) There exist candidates
-     ;; &  Not a sole exactly matching candidate
+     ;; 2) Single matching candidate
+     ((and (not (equal str "")) (equal corfu--candidates (list str)))
+      (corfu--done str 'exact))
+     ;; 3) There exist candidates
      ;; &  Input is non-empty or continue command
      ;; => Show candidates popup
-     ((and corfu--candidates
-           (not (equal corfu--candidates (list str)))
-           continue)
+     ((and corfu--candidates continue)
       (corfu--candidates-popup beg)
       (when (>= corfu--index 0)
         (corfu--echo-documentation (nth corfu--index corfu--candidates))
         (corfu--preview-current beg end str (nth corfu--index 
corfu--candidates))))
-     ;; 3) When after `completion-at-point/corfu-complete', no further
+     ;; 4) When after `completion-at-point/corfu-complete', no further
      ;; completion is possible and the current string is a valid match, exit
      ;; with status 'finished.
      ((and (memq this-command '(corfu-complete completion-at-point))
            (not (consp (completion-try-completion str table pred pt 
corfu--metadata)))
            (test-completion str table pred))
       (corfu--done str 'finished))
-     ;; 4) There are no candidates & corfu-quit-no-match => Confirmation popup
+     ;; 5) There are no candidates & corfu-quit-no-match => Confirmation popup
      ((not (or corfu--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.



reply via email to

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