[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/corfu 9b199fafda 1/3: corfu--in-region: Fix behavior fo
From: |
ELPA Syncer |
Subject: |
[elpa] externals/corfu 9b199fafda 1/3: corfu--in-region: Fix behavior for single match |
Date: |
Sat, 30 Apr 2022 00:57:28 -0400 (EDT) |
branch: externals/corfu
commit 9b199fafdaeca1fda41aca17c6b486ba224f60cb
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
corfu--in-region: Fix behavior for single match
- If further completion is possible, setup the Corfu popup.
- Otherwise call the exit function.
---
corfu.el | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/corfu.el b/corfu.el
index dc29dfd135..0462371122 100644
--- a/corfu.el
+++ b/corfu.el
@@ -1090,12 +1090,14 @@ See `completion-in-region' for the arguments BEG, END,
TABLE, PRED."
(completion--replace beg end (concat newstr)))
(goto-char (+ beg newpt))
(if (= total 1)
- (when exit
- (funcall exit newstr
- ;; If completion is finished and cannot be further
completed,
- ;; return 'finished. Otherwise return 'exact.
- (if (eq (try-completion (car candidates) table pred)
t)
- 'finished 'exact)))
+ ;; If completion is finished and cannot be further completed,
+ ;; return 'finished. Otherwise setup the Corfu popup.
+ (cond
+ ((consp (completion-try-completion
+ newstr table pred newpt
+ (completion-metadata newstr table pred)))
+ (corfu--setup))
+ (exit (funcall exit newstr 'finished)))
(if (or (= total 0) (not threshold)
(and (not (eq threshold t)) (< threshold total)))
(corfu--setup)