mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-21 12:50:09 -04:00
fix(folds.ecma): separate folds for if/else/else if
With large if/else/else if blocks, it's difficult to notice that folding an if statement also folds the else and else if statements along with them. By allowing the folds of the if, else, and else if statements to be separate, the folds are easier to distinguish and are more granular.
This commit is contained in:
parent
684eeac91e
commit
e0d861b23a
1 changed files with 8 additions and 0 deletions
|
|
@ -22,3 +22,11 @@
|
|||
(generator_function)
|
||||
(generator_function_declaration)
|
||||
] @fold
|
||||
|
||||
(if_statement
|
||||
consequence: (statement_block) @fold
|
||||
(#offset! @fold 0 0 -1 0))
|
||||
|
||||
(if_statement
|
||||
alternative: (else_clause) @fold
|
||||
(#offset! @fold 0 0 -1 0))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue