summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Mendler <mail@daniel-mendler.de>2025-11-07 14:24:51 +0100
committerDaniel Mendler <mail@daniel-mendler.de>2025-11-07 14:34:31 +0100
commit688d8d24317c812b88e2eb3a7f3fe172fab6ec78 (patch)
treec35e5d72885258ef43149f134142f87b84d8fe6a
parent76ee8f4e57d4cfb0deb3988cde199e6028cfbe7e (diff)
Try to fix #595
-rw-r--r--corfu.el22
1 files changed, 12 insertions, 10 deletions
diff --git a/corfu.el b/corfu.el
index 34c51ae..082dadb 100644
--- a/corfu.el
+++ b/corfu.el
@@ -976,16 +976,18 @@ See `completion-in-region' for the arguments BEG, END, TABLE, PRED."
(cands (alist-get 'corfu--candidates state)))
(cond
((<= total 1)
- ;; If completion is finished and cannot be extended further and
- ;; `corfu-on-exact-match' is not 'show, return 'finished. Otherwise
- ;; setup the popup.
- (if (and (= total 1)
- (or (eq corfu-on-exact-match 'show)
- (consp (completion-try-completion
- newstr table pred newpt
- (completion-metadata newstr table pred)))))
- (corfu--setup beg end table pred)
- (corfu--exit-function newstr 'finished cands)))
+ (cond
+ ;; Setup popup if completion can continue or if
+ ;; `corfu-on-exact-match' is `show'.
+ ((and (= total 1)
+ (or (eq corfu-on-exact-match 'show)
+ (consp (completion-try-completion
+ newstr table pred newpt
+ (completion-metadata newstr table pred)))))
+ (corfu--setup beg end table pred))
+ ;; Otherwise exit completion with status `finished'.
+ ((test-completion newstr table pred)
+ (corfu--exit-function newstr 'finished cands))))
;; Too many candidates for cycling -> Setup popup.
((or (not threshold) (and (not (eq threshold t)) (< threshold total)))
(corfu--setup beg end table pred))