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

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

[elpa] externals/corfu 8dd1cb7d17: Rename corfu-insert-single to corfu-o


From: ELPA Syncer
Subject: [elpa] externals/corfu 8dd1cb7d17: Rename corfu-insert-single to corfu-on-exact-match (See #109)
Date: Sat, 12 Feb 2022 14:57:24 -0500 (EST)

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

    Rename corfu-insert-single to corfu-on-exact-match (See #109)
---
 README.org |  2 +-
 corfu.el   | 16 +++++++++-------
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/README.org b/README.org
index 45c8552588..e41b781d01 100644
--- a/README.org
+++ b/README.org
@@ -87,7 +87,7 @@
       ;; (corfu-quit-no-match nil)      ;; Never quit, even if there is no 
match
       ;; (corfu-preview-current nil)    ;; Disable current candidate preview
       ;; (corfu-preselect-first nil)    ;; Disable candidate preselection
-      ;; (corfu-insert-single nil)      ;; Do not insert single matches 
automatically
+      ;; (corfu-on-exact-match nil)     ;; Configure handling of exact matches
       ;; (corfu-echo-documentation nil) ;; Disable documentation in the echo 
area
       ;; (corfu-scroll-margin 5)        ;; Use scroll margin
 
diff --git a/corfu.el b/corfu.el
index 5fb0cdc53f..02d14308e4 100644
--- a/corfu.el
+++ b/corfu.el
@@ -64,9 +64,9 @@ The value should lie between 0 and corfu-count/2."
   "Enable cycling for `corfu-next' and `corfu-previous'."
   :type 'boolean)
 
-(defcustom corfu-insert-single t
-  "Automatically insert single matching candidate."
-  :type 'boolean)
+(defcustom corfu-on-exact-match 'insert
+  "Configure how a single exact match should be handled."
+  :type '(choice (const insert) (const quit) (const nil)))
 
 (defcustom corfu-continue-commands
   ;; nil is undefined command
@@ -818,13 +818,15 @@ there hasn't been any input, then quit."
      ;; 1) Initializing, no candidates => Quit. Happens during auto completion.
      ((and initializing (not corfu--candidates))
       (corfu-quit))
-     ;; 2) Single matching candidate and no further completion is possible.
+     ;; 2) Single exactly matching candidate and no further completion is 
possible.
      ((and (not (equal str ""))
            (equal (car corfu--candidates) str) (not (cdr corfu--candidates))
            (not (consp (completion-try-completion str table pred pt 
corfu--metadata)))
-           (or initializing corfu-insert-single))
-      ;; Quit directly, happens during auto completion.
-      (if initializing (corfu-quit) (corfu--done str 'finished)))
+           (or initializing corfu-on-exact-match))
+      ;; Quit directly when initializing. This happens during auto completion.
+      (if (or initializing (eq corfu-on-exact-match 'quit))
+          (corfu-quit)
+        (corfu--done str 'finished)))
      ;; 3) There exist candidates => Show candidates popup.
      (corfu--candidates
       (corfu--candidates-popup beg)



reply via email to

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