mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-17 02:40:09 -04:00
fix(c_indents): fix expression leaking indents
This commit is contained in:
parent
474c59dcf1
commit
9161093fc7
3 changed files with 46 additions and 1 deletions
|
|
@ -6,9 +6,15 @@
|
|||
(compound_literal_expression)
|
||||
(initializer_list)
|
||||
(init_declarator)
|
||||
(expression_statement)
|
||||
] @indent.begin
|
||||
|
||||
; With current indent logic, if we capture expression_statement with @indent.begin
|
||||
; It will be affected by _parent_ node with error subnodes deep down the tree
|
||||
; So narrow indent capture to check for error inside expression statement only,
|
||||
(expression_statement
|
||||
(_) @indent.begin
|
||||
";" @indent.end)
|
||||
|
||||
(
|
||||
ERROR
|
||||
"for" "(" @indent.begin ";" ";" ")" @indent.end)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue