Skip to content

Commit

Permalink
Refactor textobject node capture (helix-editor#2741)
Browse files Browse the repository at this point in the history
  • Loading branch information
sudormrfbin authored and lazytanuki committed Jun 21, 2022
1 parent 2e693c9 commit 8b6efb3
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 8b6efb3

Please sign in to comment.