(treesit-simple-indent-presets): Have n-p-gp check for grandparent's presence
* lisp/treesit.el (treesit-simple-indent-presets): Have n-p-gp check for grandparent's presence before checking its type.
This commit is contained in:
parent
25ddb3f7d9
commit
fb82d4e328
1 changed files with 6 additions and 4 deletions
|
@ -1102,10 +1102,12 @@ See `treesit-simple-indent-presets'.")
|
|||
(string-match-p
|
||||
parent-t (treesit-node-type parent)))
|
||||
(or (null grand-parent-t)
|
||||
(string-match-p
|
||||
grand-parent-t
|
||||
(treesit-node-type
|
||||
(treesit-node-parent parent))))))))
|
||||
(and
|
||||
(treesit-node-parent parent)
|
||||
(string-match-p
|
||||
grand-parent-t
|
||||
(treesit-node-type
|
||||
(treesit-node-parent parent)))))))))
|
||||
(cons 'no-node (lambda (node &rest _) (null node)))
|
||||
(cons 'parent-is (lambda (type)
|
||||
(lambda (_n parent &rest _)
|
||||
|
|
Loading…
Add table
Reference in a new issue