summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Mendler <mail@daniel-mendler.de>2021-08-10 11:39:09 +0200
committerDaniel Mendler <mail@daniel-mendler.de>2021-08-10 11:39:09 +0200
commit5164177638322420eca16c0cb94b9b19e3fba67a (patch)
treef6a075080c9d3791a395f2618ac5919834878127
parent68ea28e987f4079f45916800f1a7b9530600a198 (diff)
Refine the corfu-complete criterion
-rw-r--r--corfu.el9
1 files changed, 5 insertions, 4 deletions
diff --git a/corfu.el b/corfu.el
index 7364887..5acfa03 100644
--- a/corfu.el
+++ b/corfu.el
@@ -813,15 +813,16 @@ completion began less than that number of seconds ago."
((and `(,newstr . ,newpt) (guard (not (equal str newstr))))
(completion--replace beg end newstr)
(goto-char (+ beg newpt)))
- ;; When the last command was `corfu-complete' and we didn't make progress,
- ;; insert the first candidate.
- ((guard (and (eq last-command #'corfu-complete) (> corfu--total 0)))
+ ;; If we didn't make progress, the last command was `corfu-complete'
+ ;; and we are not at completion boundary, continue with the first candidate.
+ ((guard (and (eq last-command #'corfu-complete)
+ (> (length str) corfu--base)
+ (> corfu--total 0)))
(completion--replace beg end
(concat (substring str 0 corfu--base)
(substring-no-properties
(car corfu--candidates))))))))))
-
(defun corfu--insert (status)
"Insert current candidate, exit with STATUS if non-nil."
(pcase-let* ((`(,beg ,end ,table ,pred) completion-in-region--data)