summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Mendler <mail@daniel-mendler.de>2022-01-24 12:24:36 +0100
committerDaniel Mendler <mail@daniel-mendler.de>2022-01-24 12:24:36 +0100
commitd708e278712bb9f776cf9a031e5a6df21adc5dfa (patch)
tree4e9376d83b86e7fcc1da71b8dc8da98c78bdc5ef
parent0b17ff6cfd526d1ec48ede9bf448f97910ecbc6e (diff)
Improve quitting behavior for auto completion (Fix #108)
-rw-r--r--corfu.el5
1 files changed, 3 insertions, 2 deletions
diff --git a/corfu.el b/corfu.el
index 805cbd0..123e89d 100644
--- a/corfu.el
+++ b/corfu.el
@@ -796,14 +796,15 @@ there hasn't been any input, then quit."
nil)
(error (corfu-quit)
(message "Corfu completion error: %s" (error-message-string err)))))
- ;; 1) Initializing, no candidates => 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
((and (not (equal str ""))
(equal corfu--candidates (list str))
(not (consp (completion-try-completion str table pred pt corfu--metadata))))
- (corfu--done str (if initializing 'exact 'finished)))
+ ;; Quit directly, happens during auto completion!
+ (if initializing (corfu-quit) (corfu--done str 'finished)))
;; 3) There exist candidates
;; & Input is non-empty or continue command
;; => Show candidates popup