completion/ivy: inhibit ivy completion in evil-ex

`ivy-completion-in-region' struggles with completing certain
+evil-ex-specific constructs, like globs (:e prefix*.el) or vim filename
modifiers (:e %:p:h).
This commit is contained in:
Henrik Lissner 2019-06-07 23:08:23 +02:00
parent 47530bd19f
commit 766fc3e4a9
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -87,6 +87,13 @@ immediately runs it on the current candidate (ending the ivy session)."
(after! yasnippet
(add-to-list 'yas-prompt-functions #'+ivy-yas-prompt nil #'eq))
(defun +ivy*inhibit-ivy-in-evil-ex (orig-fn &rest args)
"`ivy-completion-in-region' struggles with completing certain
evil-ex-specific constructs, so we disable it solely in evil-ex."
(let ((completion-in-region-function #'completion--in-region))
(apply orig-fn args)))
(advice-add #'evil-ex :around #'+ivy*inhibit-ivy-in-evil-ex)
(define-key! ivy-mode-map
[remap switch-to-buffer] #'+ivy/switch-buffer
[remap switch-to-buffer-other-window] #'+ivy/switch-buffer-other-window