From 4a27e2d93846f3b66ab0dc225e65d2fb869463f3 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Mon, 6 Jun 2022 10:18:14 -0500 Subject: [PATCH] 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. --- runtime/queries/rust/textobjects.scm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/runtime/queries/rust/textobjects.scm b/runtime/queries/rust/textobjects.scm index b2769c1393ef..ba86050b5177 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)+