mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
feat(python): add "return" patterns to @indent_end
`return ...` is usually the last line of a function/statement, so mark some possible patterns of `return` with `@indent_end` to dedent the line after it
This commit is contained in:
parent
273d5e9ac5
commit
01e8a51451
3 changed files with 29 additions and 0 deletions
|
|
@ -72,6 +72,15 @@
|
|||
(list_pattern "]" @indent_end)
|
||||
|
||||
|
||||
(return_statement
|
||||
[
|
||||
(_) @indent_end
|
||||
(_ (_) @indent_end .)
|
||||
(attribute
|
||||
attribute: (_) @indent_end)
|
||||
"return" @indent_end
|
||||
] .)
|
||||
|
||||
[
|
||||
")"
|
||||
"]"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue