on master help sign in
Refactor textobject node capture (#2741)
0b8a00aGokul Soumya
helix-core/src/syntax.rs+1−7
@@ -308,13 +308,7 @@ impl TextObjectQuery {
308 let nodes: Vec<_> = mat
308 let nodes: Vec<_> = mat
309 .captures
309 .captures
310 .iter()
310 .iter()
311− .filter_map(|x| {
312− if x.index == capture_idx {
311+ .filter_map(|cap| (cap.index == capture_idx).then(|| cap.node))
313− Some(x.node)
314− } else {
315− None
316− }
317− })
318 .collect();
312 .collect();
319
313
320 if nodes.len() > 1 {
314 if nodes.len() > 1 {