mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
feat(corfu): both
option for RET behavior
Adds a new value of `+corfu-want-ret-to-confirm` to cover the case where the user wants to select the candidate as well as perform the normal behavior of RET. Also, the logic for RET behavior has been refactored for clarity, and the variable's documentation has been clarified a little.
This commit is contained in:
@ -482,16 +482,23 @@ Continues comments if executed from a commented line. Consults
|
||||
(cond ((null +corfu-want-ret-to-confirm)
|
||||
(corfu-quit)
|
||||
nil)
|
||||
((eq +corfu-want-ret-to-confirm 'minibuffer)
|
||||
((eq +corfu-want-ret-to-confirm t)
|
||||
(if (>= corfu--index 0)
|
||||
cmd
|
||||
nil))
|
||||
((eq +corfu-want-ret-to-confirm 'both)
|
||||
(funcall-interactively cmd)
|
||||
nil)
|
||||
((and (or (not (minibufferp nil t))
|
||||
(eq +corfu-want-ret-to-confirm t))
|
||||
(>= corfu--index 0))
|
||||
cmd)
|
||||
((or (not (minibufferp nil t))
|
||||
(eq +corfu-want-ret-to-confirm t))
|
||||
nil)
|
||||
((eq +corfu-want-ret-to-confirm 'minibuffer)
|
||||
(if (minibufferp nil t)
|
||||
;; 'both' behavior
|
||||
(progn
|
||||
(funcall-interactively cmd)
|
||||
nil)
|
||||
;; 't' behavior
|
||||
(if (>= corfu--index 0)
|
||||
cmd
|
||||
nil)))
|
||||
(t cmd))))))
|
||||
(map! :when (modulep! :completion corfu)
|
||||
:map corfu-map
|
||||
|
Reference in New Issue
Block a user