aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Davis2022-06-06 15:18:14 +0000
committerBlaž Hrastnik2022-06-07 11:03:31 +0000
commit4a27e2d93846f3b66ab0dc225e65d2fb869463f3 (patch)
treecac7d7f64e4fd36fce5fd86bc2ea64989b9c6ac1
parentf7a3d357527ab30970c8da9a8ebea9e0df88329b (diff)
capture rust closures as function textobjects
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.
-rw-r--r--runtime/queries/rust/textobjects.scm2
1 files changed, 2 insertions, 0 deletions
diff --git a/runtime/queries/rust/textobjects.scm b/runtime/queries/rust/textobjects.scm
index b2769c13..ba86050b 100644
--- a/runtime/queries/rust/textobjects.scm
+++ b/runtime/queries/rust/textobjects.scm
@@ -7,6 +7,8 @@
(function_item
body: (_) @function.inside)) @function.around
+(closure_expression body: (_) @function.inside) @function.around
+
(
[
(attribute_item)+