From a3aaa508f729e8962c090b8e8751afb92c43af6d Mon Sep 17 00:00:00 2001 From: randy1burrell Date: Thu, 28 Jan 2021 17:15:27 -0500 Subject: fix: Evil-collection inhibiting company popup This update uses `evil-collection-company-supported-p` to handle the logic of showing company completions when `evil-mode` is active/inactive and in a supported buffer. If applied, this commit will: * Help `evil-collection` to determine supported states when `evil-mode` is active/inactive * Fix the bug caused by `evil-collection-company-supported-p` where it inhibits company completions from showing due to not being in `evil-mode` --- modes/company/evil-collection-company.el | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/modes/company/evil-collection-company.el b/modes/company/evil-collection-company.el index 3eb8838..eae5c88 100644 --- a/modes/company/evil-collection-company.el +++ b/modes/company/evil-collection-company.el @@ -63,13 +63,10 @@ be set through custom or before evil-collection loads." "Return non-nil if `evil-state' is in supported states." (cond ((eq command 'prefix) - (memq evil-state evil-collection-company-supported-states)) + (or (and (bound-and-true-p evil-mode) (memq evil-state evil-collection-company-supported-states)) + (not (bound-and-true-p evil-mode)))) (t t))) -(defun evil-collection-company-popup () - "When `evil-mode' is active, make `company-mode' not show popup if not in supported state." - (advice-add 'company-call-backend :before-while 'evil-collection-company-supported-p)) - ;;;###autoload (defun evil-collection-company-setup () "Set up `evil' bindings for `company'." @@ -102,7 +99,7 @@ be set through custom or before evil-collection loads." (company-tng-configure-default))) ;; Make `company-mode' not show popup when not in supported state - (add-hook 'evil-mode-hook 'evil-collection-company-popup)) + (advice-add 'company-call-backend :before-while 'evil-collection-company-supported-p)) (provide 'evil-collection-company) -- cgit v1.0