From 1466f6f7effc0a783c8acda66471be0db11f789a Mon Sep 17 00:00:00 2001 From: Daniel Mendler Date: Sun, 19 Apr 2026 20:08:22 +0200 Subject: Improve corfu--move-to-front --- corfu.el | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/corfu.el b/corfu.el index 97d05ca..026282a 100644 --- a/corfu.el +++ b/corfu.el @@ -536,12 +536,11 @@ FRAME is the existing frame." (run-at-time 0 nil #'corfu--hide-frame-deferred frame)))))) (defun corfu--move-to-front (elem list) - "Move ELEM to front of 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))) + "Move all ELEM (also duplicates) to front of LIST." + (if (member elem list) + (nconc (cl-loop for x in list if (equal x elem) collect x) + (delete elem list)) + list)) (defun corfu--filter-completions (&rest args) "Compute all completions for ARGS with lazy highlighting." -- cgit v1.0