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

Consider non-string minibuffer-default in icomplete

Fixes: bug#38992

* lisp/icomplete.el (icomplete--sorted-completions): Consider
non-string minibuffer-default.
parent 1fe596d8
......@@ -448,13 +448,14 @@ Usually run by inclusion in `minibuffer-setup-hook'."
with end = (icomplete--field-end)
with all = (completion-all-sorted-completions beg end)
for fn in (cond ((and minibuffer-default
(stringp minibuffer-default) ; bug#38992
(= (icomplete--field-end) (icomplete--field-beg)))
;; When we have a non-nil default and no input
;; whatsoever: we want to make sure that default
;; is bubbled to the top so that
;; When we have a non-nil string default and
;; no input whatsoever: we want to make sure
;; that default is bubbled to the top so that
;; `icomplete-force-complete-and-exit' will
;; select it (do that even if the match doesn't
;; match the completion perfectly.
;; select it (do that even if the match
;; doesn't match the completion perfectly.
`(,(lambda (comp)
(equal minibuffer-default comp))
,(lambda (comp)
......
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