From 83e0fd74abbb18e02019579ceb6a134c0b5bd2d7 Mon Sep 17 00:00:00 2001 From: Kien Nguyen Date: Sun, 31 Mar 2024 01:33:50 -0700 Subject: [PATCH 1/2] fix: show corfu popup when in insertable state --- modes/corfu/evil-collection-corfu.el | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modes/corfu/evil-collection-corfu.el b/modes/corfu/evil-collection-corfu.el index 8c219bdc..89dafd25 100644 --- a/modes/corfu/evil-collection-corfu.el +++ b/modes/corfu/evil-collection-corfu.el @@ -71,6 +71,10 @@ This key theme variable may be refactored in the future so use with caution." (const :tag "Magic Backspace" magic-backspace)))) +(defcustom evil-collection-corfu-supported-states '(insert replace emacs) + "The `evil-state's which `corfu' function can be requested." + :type '(repeat symbol)) + ;;;###autoload (defun evil-collection-corfu-setup () "Set up `evil' bindings for `corfu'." @@ -129,7 +133,10 @@ This key theme variable may be refactored in the future so use with caution." (kbd "C-u") 'corfu-scroll-down)) (advice-add 'corfu--setup :after (lambda (&rest _) (evil-normalize-keymaps))) - (advice-add 'corfu--teardown :after (lambda (&rest _) (evil-normalize-keymaps)))) + (advice-add 'corfu--teardown :after (lambda (&rest _) (evil-normalize-keymaps))) + (advice-add 'corfu--continue-p + :before-while (lambda (&rest _) (memq evil-state evil-collection-corfu-supported-states))) + ) (provide 'evil-collection-corfu) ;;; evil-collection-corfu.el ends here From b15c0c5819e9ebd2328d374235a55be373c2a755 Mon Sep 17 00:00:00 2001 From: Kien Nguyen Date: Sun, 31 Mar 2024 10:44:51 -0700 Subject: [PATCH 2/2] nit --- modes/corfu/evil-collection-corfu.el | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modes/corfu/evil-collection-corfu.el b/modes/corfu/evil-collection-corfu.el index 89dafd25..c76f8392 100644 --- a/modes/corfu/evil-collection-corfu.el +++ b/modes/corfu/evil-collection-corfu.el @@ -135,8 +135,7 @@ This key theme variable may be refactored in the future so use with caution." (advice-add 'corfu--setup :after (lambda (&rest _) (evil-normalize-keymaps))) (advice-add 'corfu--teardown :after (lambda (&rest _) (evil-normalize-keymaps))) (advice-add 'corfu--continue-p - :before-while (lambda (&rest _) (memq evil-state evil-collection-corfu-supported-states))) - ) + :before-while (lambda (&rest _) (memq evil-state evil-collection-corfu-supported-states)))) (provide 'evil-collection-corfu) ;;; evil-collection-corfu.el ends here