Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: show corfu popup when in insertable state #800

Merged
merged 2 commits into from
Apr 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion modes/corfu/evil-collection-corfu.el
Original file line number Diff line number Diff line change
Expand Up @@ -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'."
Expand Down Expand Up @@ -129,7 +133,9 @@ 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
Loading