Commit d9c6b437 authored by João Távora's avatar João Távora

Protect flex's display-sort-function against 0-length candidates

* lisp/minibuffer.el (completion--flex-adjust-metadata): Assume a
candidate missing a score has a score of 0.
parent 7362554e
......@@ -3496,8 +3496,9 @@ that is non-nil."
res
(lambda (c1 c2)
(or (equal c1 minibuffer-default)
(> (get-text-property 0 'completion-score c1)
(get-text-property 0 'completion-score c2)))))))))
(let ((s1 (get-text-property 0 'completion-score c1))
(s2 (get-text-property 0 'completion-score c2)))
(> (or s1 0) (or s2 0))))))))))
`(metadata
(display-sort-function
. ,(compose-flex-sort-fn
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment