Skip to content

Commit

Permalink
ignore empty TS nodes in match bracket
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalkuthe authored and archseer committed Jan 15, 2024
1 parent 2fb7e50 commit 445f7a2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions helix-core/src/match_brackets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ fn find_pair(
let tree = syntax.tree();
let pos = doc.char_to_byte(pos_);

let mut node = tree.root_node().descendant_for_byte_range(pos, pos)?;
let mut node = tree.root_node().descendant_for_byte_range(pos, pos + 1)?;

loop {
if node.is_named() {
Expand Down Expand Up @@ -118,7 +118,9 @@ fn find_pair(
};
node = parent;
}
let node = tree.root_node().named_descendant_for_byte_range(pos, pos)?;
let node = tree
.root_node()
.named_descendant_for_byte_range(pos, pos + 1)?;
if node.child_count() != 0 {
return None;
}
Expand Down

0 comments on commit 445f7a2

Please sign in to comment.