diff options
| author | Daniel Mendler <mail@daniel-mendler.de> | 2021-11-12 13:12:21 +0100 |
|---|---|---|
| committer | Daniel Mendler <mail@daniel-mendler.de> | 2021-11-12 13:29:32 +0100 |
| commit | c16e89f38d950d2517ffcf17c15787293fc14e3b (patch) | |
| tree | e877dd97cd88c633ecc44b468a311b1ed1948a34 | |
| parent | 53b231694a33970807c26e37be11d29154e19c59 (diff) | |
Reformat comments
| -rw-r--r-- | corfu.el | 29 |
1 files changed, 18 insertions, 11 deletions
@@ -712,29 +712,36 @@ A scroll bar is displayed from LO to LO+BAR." nil) (t (corfu-quit) (message "Corfu completion error: %s" (error-message-string err))))) - ((and initializing (not corfu--candidates)) ;; 1) Initializing, no candidates - (funcall msg "No match") ;; => Show error message + ;; 1) Initializing, no candidates => Show error message and quit + ((and initializing (not corfu--candidates)) + (funcall msg "No match") (corfu-quit)) - ((and corfu--candidates ;; 2) There exist candidates - (not (equal corfu--candidates (list str))) ;; & Not a sole exactly matching candidate - continue) ;; & Input is non-empty or continue command - (corfu--show-candidates beg end str)) ;; => Show candidates popup - ;; 3) When after `completion-at-point/corfu-complete', no further completion is possible and the - ;; current string is a valid match, exit with status 'finished. + ;; 2) There exist candidates + ;; & Not a sole exactly matching candidate + ;; & Input is non-empty or continue command + ;; => Show candidates popup + ((and corfu--candidates + (not (equal corfu--candidates (list str))) + continue) + (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 + ;; with status 'finished. ((and (memq this-command '(corfu-complete completion-at-point)) - (not (stringp (try-completion str table pred))) ;; XXX We should probably use `completion-try-completion' here instead ;; but it does not work as well when completing in `shell-mode'. ;; (not (consp (completion-try-completion str table pred pt metadata))) + (not (stringp (try-completion str table pred))) (test-completion str table pred)) (corfu--done str 'finished)) - ((not (or corfu--candidates ;; 4) There are no candidates + ;; 4) There are no candidates & corfu-quit-no-match => Confirmation popup + ((not (or corfu--candidates ;; When `corfu-quit-no-match' is a number of seconds and the auto completion wasn't ;; initiated too long ago, quit directly without showing the "No match" popup. (if (and corfu--auto-start (numberp corfu-quit-no-match)) (< (- (float-time) corfu--auto-start) corfu-quit-no-match) (eq t corfu-quit-no-match)))) - (corfu--popup-show beg 0 8 '(#("No match" 0 8 (face italic))))) ;; => Confirmation popup + (corfu--popup-show beg 0 8 '(#("No match" 0 8 (face italic))))) (t (corfu-quit))))) (defun corfu--pre-command () |
