fix(config): fix corfu smart tab behavior

This commit is contained in:
StrawberryTea 2024-05-10 22:08:32 -05:00
parent 390f5920a2
commit 0a4d22e5b7
2 changed files with 6 additions and 9 deletions

View file

@ -1,7 +0,0 @@
;;; config/default/autoload/filters.el -*- lexical-binding: t; -*-
;;;###autoload
(defun +yas-active-p ()
"Return t if we are in a YASnippet field."
(memq (bound-and-true-p yas--active-field-overlay)
(overlays-in (1- (point)) (1+ (point)))))

View file

@ -496,13 +496,15 @@ Continues comments if executed from a commented line. Consults
(cond (cond
,@(when (modulep! :editor snippets) ,@(when (modulep! :editor snippets)
'(((and +corfu-want-tab-prefer-navigating-snippets '(((and +corfu-want-tab-prefer-navigating-snippets
(+yas-active-p)) (memq (bound-and-true-p yas--active-field-overlay)
(overlays-in (1- (point)) (1+ (point)))))
#'yas-next-field-or-maybe-expand) #'yas-next-field-or-maybe-expand)
((and +corfu-want-tab-prefer-expand-snippets ((and +corfu-want-tab-prefer-expand-snippets
(yas-maybe-expand-abbrev-key-filter 'yas-expand)) (yas-maybe-expand-abbrev-key-filter 'yas-expand))
#'yas-expand))) #'yas-expand)))
,@(when (modulep! :lang org) ,@(when (modulep! :lang org)
'(((and +corfu-want-tab-prefer-navigating-org-tables '(((and +corfu-want-tab-prefer-navigating-org-tables
(featurep 'org)
(org-at-table-p)) (org-at-table-p))
#'org-table-next-field))) #'org-table-next-field)))
(t cmd)))) ) (t cmd)))) )
@ -513,10 +515,12 @@ Continues comments if executed from a commented line. Consults
(cond (cond
,@(when (modulep! :editor snippets) ,@(when (modulep! :editor snippets)
'(((and +corfu-want-tab-prefer-navigating-snippets '(((and +corfu-want-tab-prefer-navigating-snippets
(+yas-active-p)) (memq (bound-and-true-p yas--active-field-overlay)
(overlays-in (1- (point)) (1+ (point)))))
#'yas-prev-field))) #'yas-prev-field)))
,@(when (modulep! :lang org) ,@(when (modulep! :lang org)
'(((and +corfu-want-tab-prefer-navigating-org-tables '(((and +corfu-want-tab-prefer-navigating-org-tables
(featurep 'org)
(org-at-table-p)) (org-at-table-p))
#'org-table-previous-field))) #'org-table-previous-field)))
(t cmd)))))) (t cmd))))))