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