diff options
| author | Daniel Mendler <mail@daniel-mendler.de> | 2023-12-23 12:00:17 +0100 |
|---|---|---|
| committer | Daniel Mendler <mail@daniel-mendler.de> | 2023-12-23 12:00:17 +0100 |
| commit | 8167301b61ff479d34cb3e069154cfa119ed3b44 (patch) | |
| tree | 8a89dcae85cb81c1a0b83f299c22825bb4df6b51 | |
| parent | 9cebcfedca0ab165fcfc8a56acc2d2513a02b9e3 (diff) | |
corfu--move-to-front: Handle duplicates
| -rw-r--r-- | corfu.el | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -518,9 +518,11 @@ FRAME is the existing frame." (defun corfu--move-to-front (elem list) "Move ELEM to front of LIST." - (if-let ((found (member elem list))) - (nconc (list (car found)) (delq (setcar found nil) list)) - list)) + ;; In contrast to Vertico, this function handles duplicates. See also the + ;; special deduplication function `corfu--delete-dups' based on + ;; `equal-including-properties' + (nconc (cl-loop for x in list if (equal x elem) collect x) + (delete elem list))) (defun corfu--filter-completions (&rest args) "Compute all completions for ARGS with lazy highlighting." |
