summaryrefslogtreecommitdiff
path: root/corfu.el
diff options
context:
space:
mode:
authorDaniel Mendler <mail@daniel-mendler.de>2025-11-07 14:29:12 +0100
committerDaniel Mendler <mail@daniel-mendler.de>2025-11-07 14:34:31 +0100
commit387f9acc5135206dfc6fbf6f19ebc69375209384 (patch)
tree015291c3104dc018e5c5499d02ec24743a924a46 /corfu.el
parent688d8d24317c812b88e2eb3a7f3fe172fab6ec78 (diff)
corfu-complete: Improve comment
Diffstat (limited to 'corfu.el')
-rw-r--r--corfu.el8
1 files changed, 4 insertions, 4 deletions
diff --git a/corfu.el b/corfu.el
index 082dadb..7012a9d 100644
--- a/corfu.el
+++ b/corfu.el
@@ -1356,16 +1356,16 @@ If a candidate is selected, insert it. Otherwise invoke
(if (< corfu--index 0)
(corfu-expand)
;; Continue completion with selected candidate. Exit with status 'finished
- ;; if input is a valid match and no further completion is
- ;; possible. Additionally treat completion as finished if at the end of a
- ;; boundary, even if other longer candidates would still match, since the
- ;; user invoked `corfu-complete' with an explicitly selected candidate!
+ ;; if input is a valid match and no further completion is possible.
(pcase-let ((`(,_beg ,_end ,table ,pred . ,_) completion-in-region--data)
(newstr (corfu--insert nil)))
(and (test-completion newstr table pred)
(or (not (consp (completion-try-completion
newstr table pred (length newstr)
(completion-metadata newstr table pred))))
+ ;; Additionally finish completion if at the end of a boundary,
+ ;; even if other longer candidates match, since the user invoked
+ ;; `corfu-complete' with an explicitly selected candidate!
(equal (completion-boundaries newstr table pred "") '(0 . 0)))
(corfu--done newstr 'finished nil))
t)))