diff options
| author | Daniel Mendler <mail@daniel-mendler.de> | 2021-11-29 23:10:09 +0100 |
|---|---|---|
| committer | Daniel Mendler <mail@daniel-mendler.de> | 2021-11-29 23:10:09 +0100 |
| commit | e1e3b9732f01ac5d49da2a0cacd8dab7217c6fe4 (patch) | |
| tree | 9e16a6cd8fa40572afbf3fd817f45e037a689352 | |
| parent | 134aa0fbfb8d78f3a1c49eb7b3dae62330b7238e (diff) | |
Delete consecutive duplicates
| -rw-r--r-- | corfu.el | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -579,12 +579,11 @@ A scroll bar is displayed from LO to LO+BAR." ;; since this breaks the special casing in the `completion-file-name-table' for `file-exists-p' ;; and `file-directory-p'. (when completing-file (setq all (corfu--filter-files all))) - (setq all (funcall (or (corfu--sort-function) #'identity) all)) - (unless (equal field "") - (setq all (corfu--move-prefix-candidates-to-front field all)) - (when (and completing-file (not (string-suffix-p "/" field))) - (setq all (corfu--move-to-front (concat field "/") all))) - (setq all (corfu--move-to-front field all))) + (setq all (delete-consecutive-dups (funcall (or (corfu--sort-function) #'identity) all))) + (setq all (corfu--move-prefix-candidates-to-front field all)) + (when (and completing-file (not (string-suffix-p "/" field))) + (setq all (corfu--move-to-front (concat field "/") all))) + (setq all (corfu--move-to-front field all)) (list base all (length all) hl corfu--metadata ;; Select the prompt when the input is a valid completion ;; and if it is not equal to the first candidate. |
