diff options
| author | Daniel Mendler <mail@daniel-mendler.de> | 2022-04-30 06:31:49 +0200 |
|---|---|---|
| committer | Daniel Mendler <mail@daniel-mendler.de> | 2022-04-30 06:31:49 +0200 |
| commit | 9b199fafdaeca1fda41aca17c6b486ba224f60cb (patch) | |
| tree | cc78f2075c856834af5106ea80aa0c766c422656 | |
| parent | a37d7272a5fa45bcba106f5ba2fb8867f6153ec7 (diff) | |
corfu--in-region: Fix behavior for single match
- If further completion is possible, setup the Corfu popup.
- Otherwise call the exit function.
| -rw-r--r-- | corfu.el | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -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) |
