summaryrefslogtreecommitdiff
path: root/corfu.el
diff options
context:
space:
mode:
authorDaniel Mendler <mail@daniel-mendler.de>2021-11-12 13:29:01 +0100
committerDaniel Mendler <mail@daniel-mendler.de>2021-11-12 14:14:00 +0100
commit4b7b726279a83ba25d34cb2e895f1624c71a6f8a (patch)
tree76b24b267c6d334476b0314576f9e6b52fbdd7c9 /corfu.el
parentf28192d6f55ae681e106e0f20323d6f21a020694 (diff)
Automatically select first candidatepreview-current
Diffstat (limited to 'corfu.el')
-rw-r--r--corfu.el4
1 files changed, 4 insertions, 0 deletions
diff --git a/corfu.el b/corfu.el
index 6610aab..16be36f 100644
--- a/corfu.el
+++ b/corfu.el
@@ -729,6 +729,10 @@ A scroll bar is displayed from LO to LO+BAR."
((and corfu--candidates
(not (equal corfu--candidates (list str)))
continue)
+ ;; Automatically select first candidate!
+ (unless (or corfu-preview-current (>= corfu--index 0)
+ (test-completion str table pred))
+ (setq corfu--index 0))
(corfu--show-candidates beg end str))
;; 3) When after `completion-at-point/corfu-complete', no further
;; completion is possible and the current string is a valid match, exit