diff options
| author | Daniel Mendler <mail@daniel-mendler.de> | 2024-12-22 16:59:47 +0100 |
|---|---|---|
| committer | Daniel Mendler <mail@daniel-mendler.de> | 2024-12-22 16:59:47 +0100 |
| commit | 32ee8eefa0981a93123e97eb80bbd22f9f5e95f2 (patch) | |
| tree | 6b0558ca7abdb67bde165dd1a28fa16a18a0ee2d | |
| parent | b02f674c4523ee139365fe3c1e218af2a90d46d4 (diff) | |
corfu--in-region-1: Minor cleanup
| -rw-r--r-- | corfu.el | 14 |
1 files changed, 6 insertions, 8 deletions
@@ -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. |
