diff options
| author | James Cherti <60946298+jamescherti@users.noreply.github.com> | 2026-03-02 14:00:07 -0500 |
|---|---|---|
| committer | Youmu <condy0919@gmail.com> | 2026-03-05 00:28:58 +0800 |
| commit | a18d16675c194203c00f46334fd7c22f46e7671a (patch) | |
| tree | 15fdb26b493823ea731ecfbea45a7ca4e5476baf | |
| parent | d052ad2ec1f6a4b101f873f01517b295cd7dc4a9 (diff) | |
Add "<return>" to corfu-map when magic-return is enabled
This ensures the completion candidate is inserted when pressing the Enter key in
GUI frames. Previously, only RET was bound, which could cause the key to fall
through to the default minibuffer or evil-insert-state binding.
| -rw-r--r-- | modes/corfu/evil-collection-corfu.el | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/modes/corfu/evil-collection-corfu.el b/modes/corfu/evil-collection-corfu.el index 378874a..f70dedc 100644 --- a/modes/corfu/evil-collection-corfu.el +++ b/modes/corfu/evil-collection-corfu.el @@ -126,6 +126,9 @@ This key theme variable may be refactored in the future so use with caution." "If we made a selection during `corfu' completion, select it.") ;; FIXME: Not sure why we need to use `define-key' here instead of ;; `evil-collection-define-key';. + (when (evil-collection-can-bind-key "<return>") + (define-key corfu-map (kbd "<return>") + evil-collection-corfu-insert-or-next-line)) (when (evil-collection-can-bind-key "RET") (define-key corfu-map (kbd "RET") evil-collection-corfu-insert-or-next-line))) |
