mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
Add Python textobjects
This commit is contained in:
parent
69cabc69be
commit
d685d82682
1 changed files with 24 additions and 0 deletions
|
|
@ -1,3 +1,27 @@
|
|||
|
||||
(function_definition
|
||||
body: (block)? @function.inner) @function.outer
|
||||
|
||||
(class_definition
|
||||
body: (block)? @class.inner) @class.outer
|
||||
|
||||
(while_statement
|
||||
body: (block)? @loop.inner) @loop.outer
|
||||
|
||||
(for_statement
|
||||
body: (block)? @loop.inner) @loop.outer
|
||||
|
||||
(if_statement
|
||||
consequence: (block)? @conditional.inner
|
||||
alternative: (_ (block) @conditional.inner)?) @conditional.outer
|
||||
|
||||
(if_statement
|
||||
condition: (_) @conditional.inner)
|
||||
|
||||
(_ (block) @block.inner) @block.outer
|
||||
(comment) @comment.outer
|
||||
|
||||
(block (_) @statement.outer)
|
||||
|
||||
(call) @call.outer
|
||||
(call (_) @call.inner)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue