mirror of https://github.com/helix-editor/helix
Refactor textobject node capture (#2741)
parent
9b9c3e5ae2
commit
0b8a00ac96
|
@ -308,13 +308,7 @@ impl TextObjectQuery {
|
||||||
let nodes: Vec<_> = mat
|
let nodes: Vec<_> = mat
|
||||||
.captures
|
.captures
|
||||||
.iter()
|
.iter()
|
||||||
.filter_map(|x| {
|
.filter_map(|cap| (cap.index == capture_idx).then(|| cap.node))
|
||||||
if x.index == capture_idx {
|
|
||||||
Some(x.node)
|
|
||||||
} else {
|
|
||||||
None
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
if nodes.len() > 1 {
|
if nodes.len() > 1 {
|
||||||
|
|
Loading…
Reference in New Issue