From 766fc3e4a94932e2c7f2d4f63745526f8710d13c Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 7 Jun 2019 23:08:23 +0200 Subject: [PATCH] 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). --- modules/completion/ivy/config.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/completion/ivy/config.el b/modules/completion/ivy/config.el index d1503333a..0fe2a8a50 100644 --- a/modules/completion/ivy/config.el +++ b/modules/completion/ivy/config.el @@ -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