Skip to content

Commit

Permalink
Refactor textobject node capture (#2741)
Browse files Browse the repository at this point in the history
  • Loading branch information
sudormrfbin authored Jun 11, 2022
1 parent 9b9c3e5 commit 0b8a00a
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions helix-core/src/syntax.rs
Original file line number Diff line number Diff line change
Expand Up @@ -308,13 +308,7 @@ impl TextObjectQuery {
let nodes: Vec<_> = mat
.captures
.iter()
.filter_map(|x| {
if x.index == capture_idx {
Some(x.node)
} else {
None
}
})
.filter_map(|cap| (cap.index == capture_idx).then(|| cap.node))
.collect();

if nodes.len() > 1 {
Expand Down

0 comments on commit 0b8a00a

Please sign in to comment.