Skip to content

Commit

Permalink
capture rust closures as function textobjects
Browse files Browse the repository at this point in the history
Closures like

    iter.map(|a| a + 1)

Are sort-of functions, so `]f` or `maf` or `mif` can apply to them
as well as named function definitions.
  • Loading branch information
the-mikedavis authored and archseer committed Jun 7, 2022
1 parent f7a3d35 commit 4a27e2d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions runtime/queries/rust/textobjects.scm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
(function_item
body: (_) @function.inside)) @function.around

(closure_expression body: (_) @function.inside) @function.around

(
[
(attribute_item)+
Expand Down

0 comments on commit 4a27e2d

Please sign in to comment.