dev: merge branch 'pr7739' into emenel

This commit is contained in:
Matt Nish-Lapidus 2024-03-24 10:03:07 -04:00
commit 790c512387

View file

@ -468,54 +468,58 @@ Continues comments if executed from a commented line. Consults
(let ((cmds-del
`(menu-item "Reset completion" corfu-reset
:filter ,(lambda (cmd)
(when (and (>= corfu--index 0)
(eq corfu-preview-current 'insert))
cmd))))
(cond
((and (>= corfu--index 0)
(eq corfu-preview-current 'insert))
cmd)))))
(cmds-ret
`(menu-item "Insert completion DWIM" corfu-insert
:filter ,(lambda (cmd)
(cond ((null +corfu-want-ret-to-confirm)
(corfu-quit)
nil)
((eq +corfu-want-ret-to-confirm 'minibuffer)
(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))
(cond
((null +corfu-want-ret-to-confirm)
(corfu-quit)
nil)
((eq +corfu-want-ret-to-confirm 'minibuffer)
(funcall-interactively cmd)
nil)
((and (or (not (minibufferp nil t))
(eq +corfu-want-ret-to-confirm t))
nil)
(t cmd)))))
(>= corfu--index 0))
cmd)
((or (not (minibufferp nil t))
(eq +corfu-want-ret-to-confirm t))
nil)
(t cmd)))))
(cmds-tab
`(menu-item "Select next candidate or expand/traverse snippet" corfu-next
:filter (lambda (cmd)
(cond ,@(when (modulep! :editor snippets)
'(((and +corfu-want-tab-prefer-navigating-snippets
(+yas-active-p))
#'yas-next-field-or-maybe-expand)
((and +corfu-want-tab-prefer-expand-snippets
(yas-maybe-expand-abbrev-key-filter 'yas-expand))
#'yas-expand)))
,@(when (modulep! :lang org)
'(((and +corfu-want-tab-prefer-navigating-org-tables
(org-at-table-p))
#'org-table-next-field)))
(t cmd)))) )
(cond
,@(when (modulep! :editor snippets)
'(((and +corfu-want-tab-prefer-navigating-snippets
(+yas-active-p))
#'yas-next-field-or-maybe-expand)
((and +corfu-want-tab-prefer-expand-snippets
(yas-maybe-expand-abbrev-key-filter 'yas-expand))
#'yas-expand)))
,@(when (modulep! :lang org)
'(((and +corfu-want-tab-prefer-navigating-org-tables
(org-at-table-p))
#'org-table-next-field)))
(t cmd)))) )
(cmds-s-tab
`(menu-item "Select previous candidate or expand/traverse snippet"
corfu-previous
:filter (lambda (cmd)
(cond ,@(when (modulep! :editor snippets)
'(((and +corfu-want-tab-prefer-navigating-snippets
(+yas-active-p))
#'yas-prev-field)))
,@(when (modulep! :lang org)
'(((and +corfu-want-tab-prefer-navigating-org-tables
(org-at-table-p))
#'org-table-previous-field)))
(t cmd))))))
(cond
,@(when (modulep! :editor snippets)
'(((and +corfu-want-tab-prefer-navigating-snippets
(+yas-active-p))
#'yas-prev-field)))
,@(when (modulep! :lang org)
'(((and +corfu-want-tab-prefer-navigating-org-tables
(org-at-table-p))
#'org-table-previous-field)))
(t cmd))))))
(map! :when (modulep! :completion corfu)
:map corfu-map
[backspace] cmds-del