summaryrefslogtreecommitdiff
path: root/corfu.el
diff options
context:
space:
mode:
authorDaniel Mendler <mail@daniel-mendler.de>2024-12-22 16:59:47 +0100
committerDaniel Mendler <mail@daniel-mendler.de>2024-12-22 16:59:47 +0100
commit32ee8eefa0981a93123e97eb80bbd22f9f5e95f2 (patch)
tree6b0558ca7abdb67bde165dd1a28fa16a18a0ee2d /corfu.el
parentb02f674c4523ee139365fe3c1e218af2a90d46d4 (diff)
corfu--in-region-1: Minor cleanup
Diffstat (limited to 'corfu.el')
-rw-r--r--corfu.el14
1 files changed, 6 insertions, 8 deletions
diff --git a/corfu.el b/corfu.el
index 99a02cf..f22ea19 100644
--- a/corfu.el
+++ b/corfu.el
@@ -945,17 +945,15 @@ See `completion-in-region' for the arguments BEG, END, TABLE, PRED."
(total (alist-get 'corfu--total state))
(cands (alist-get 'corfu--candidates state)))
(cond
- ((= total 0)
- ;; No candidates found for `newstr' -> Completion is finished.
- (corfu--exit-function newstr 'finished nil))
- ((= total 1)
+ ((<= 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 (or (eq corfu-on-exact-match 'show)
- (consp (completion-try-completion
- newstr table pred newpt
- (completion-metadata newstr table pred))))
+ (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)))
;; Too many candidates for cycling -> Setup popup.