From aaa740b7feee1322b010ac003a74eb9ed6164d5e Mon Sep 17 00:00:00 2001 From: Daniel Mendler Date: Wed, 21 Dec 2022 23:36:11 +0100 Subject: preselect prototype --- corfu.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/corfu.el b/corfu.el index 1670113..e30de4e 100644 --- a/corfu.el +++ b/corfu.el @@ -644,12 +644,15 @@ A scroll bar is displayed from LO to LO+BAR." ;; equal to the first candidate. This condition prevents jumping to prompt ;; during completion for the full candidate when the incomplete candidate ;; is invalid. - (corfu--preselect . ,(if (or (not corfu-preselect-first) (not all) - (and (not (equal field (car all))) + (corfu--preselect . ,(if (or (eq corfu-preselect 'prompt) (not all) + (and (eq corfu-preselect 'valid) + (not (equal field (car all))) (not (and completing-file (equal (concat field "/") (car all)))) (test-completion str table pred))) -1 0))))) +(defvar corfu-preselect 'prompt) ;; 'prompt 'first 'valid + (defun corfu--update (&optional interruptible) "Update state, optionally INTERRUPTIBLE." (pcase-let* ((`(,beg ,end ,table ,pred) completion-in-region--data) -- cgit v1.0