@@ -308,13 +308,7 @@ impl TextObjectQuery {
308 let nodes: Vec<_> = mat
308 let nodes: Vec<_> = mat
309 .captures
309 .captures
312− if x.index == capture_idx {
311+ .filter_map(|cap| (cap.index == capture_idx).then(|| cap.node))
318 .collect();
312 .collect();
320 if nodes.len() > 1 {
314 if nodes.len() > 1 {