diff options
| author | Daniel Mendler <mail@daniel-mendler.de> | 2021-04-27 06:56:52 +0200 |
|---|---|---|
| committer | Daniel Mendler <mail@daniel-mendler.de> | 2021-04-27 06:57:05 +0200 |
| commit | 9dc4759a9af430c27621bcbefd3dad0d5d5f184a (patch) | |
| tree | b4c127e8d1cc1b0a0c1ed65e30196917d4d1ba83 | |
| parent | ba858df5e38fa904a32de768ff048efd93dde7da (diff) | |
Exit conditions: Minor cleanup
| -rw-r--r-- | corfu.el | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -429,14 +429,15 @@ If `line-spacing/=nil' or in text-mode, the background color is used instead.") (unless (equal corfu--input (cons str pt)) (corfu--update-candidates str metadata pt table pred)) (cond - ((and (not corfu--candidates) corfu-confirm) + ((and (not corfu--candidates) ;; 1. There are no candidates + corfu-confirm) ;; 2. Confirmation is enabled (corfu--popup beg (list corfu-confirm))) - ((and - corfu--candidates ;; 1. There exist candidates - (not (equal corfu--candidates (list str))) ;; 2. Not a single exactly matching candidate - (or (/= beg end) ;; 3. Input is non-empty - (eq this-command 'completion-at-point) - (string-match-p corfu--keep-alive (prin1-to-string this-command)))) + ((and corfu--candidates ;; 1. There exist candidates + (not (equal corfu--candidates (list str))) ;; 2. Not a sole exactly matching candidate + (or (/= beg end) ;; 3. Input is non-empty + (eq this-command 'completion-at-point) + (and (symbolp this-command) + (string-match-p corfu--keep-alive (symbol-name this-command))))) (corfu--update-display beg end str metadata)) ;; When after `completion-at-point/corfu-complete', no further completion is possible and the ;; current string is a valid match, exit with status 'finished. |
