Commit 60d381c6 authored by Kyle Meyer's avatar Kyle Meyer

Don't use a completion function with {ivy,helm}-mode

We use a completion function to make the built-in completion respect
the collection's order.  This wasn't necessary for completion with
helm-mode or ivy-mode, but it didn't hurt either.  See
aa5f098a (completion: override default alphabetical sorting,
2017-03-30) for more information.

As of helm's 1aca3e84 (Always use a sync handler when COLLECTION is a
function, 2018-05-24), fuzzy matching no longer works when the
collection is a function, so let's not use the completion function
when we know we don't need it.

Fixes #3476.
parent 1ee577b3
......@@ -433,13 +433,13 @@ acts similarly to `completing-read', except for the following:
(defun magit-builtin-completing-read
(prompt choices &optional predicate require-match initial-input hist def)
"Magit wrapper for standard `completing-read' function."
(unless (or (bound-and-true-p helm-mode)
(bound-and-true-p ivy-mode))
(setq prompt (magit-prompt-with-default prompt def))
(setq choices (magit--completion-table choices)))
(cl-letf (((symbol-function 'completion-pcm--all-completions)
#'magit-completion-pcm--all-completions))
(completing-read (if (or (bound-and-true-p helm-mode)
(bound-and-true-p ivy-mode))
prompt
(magit-prompt-with-default prompt def))
(magit--completion-table choices)
(completing-read prompt choices
predicate require-match
initial-input hist def)))
......
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