diff options
| author | Daniel Mendler <mail@daniel-mendler.de> | 2022-12-21 23:36:11 +0100 |
|---|---|---|
| committer | Daniel Mendler <mail@daniel-mendler.de> | 2022-12-21 23:36:11 +0100 |
| commit | aaa740b7feee1322b010ac003a74eb9ed6164d5e (patch) | |
| tree | 2dfed8b681790e9d54148b5087aa7ab1799300de | |
| parent | 8b4c3c27ab49b7a5f42d880565e4c8b2d01bc025 (diff) | |
preselect prototype
| -rw-r--r-- | corfu.el | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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) |
