Skip to content

Commit

Permalink
Small prefix search optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
jdtsmith committed Feb 7, 2022
1 parent f103557 commit fe491a5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions corfu.el
Original file line number Diff line number Diff line change
Expand Up @@ -559,8 +559,8 @@ A scroll bar is displayed from LO to LO+BAR."

(defun corfu--move-prefix-candidates-to-front (field candidates)
"Move CANDIDATES which match prefix of FIELD to the beginning."
(let* ((word (substring field 0
(seq-position field corfu-separator-char)))
(let* ((pos (seq-position field corfu-separator-char))
(word (if pos (substring field 0 pos) field))
(len (length word)))
(corfu--partition!
candidates
Expand Down

0 comments on commit fe491a5

Please sign in to comment.