aboutsummaryrefslogtreecommitdiff
path: root/helix-core
diff options
context:
space:
mode:
authorPascal Kuthe2024-01-13 23:21:49 +0000
committerBlaž Hrastnik2024-01-15 06:32:07 +0000
commit445f7a273a27d74d8168eab7941dcb3479d31ebe (patch)
tree16ca80fdf67a0fa37347d4afc86d77d1009f438e /helix-core
parent2fb7e50b549842999639434dc433f22928678082 (diff)
ignore empty TS nodes in match bracket
Diffstat (limited to 'helix-core')
-rw-r--r--helix-core/src/match_brackets.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/helix-core/src/match_brackets.rs b/helix-core/src/match_brackets.rs
index e49b408a..150679b5 100644
--- a/helix-core/src/match_brackets.rs
+++ b/helix-core/src/match_brackets.rs
@@ -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() {
@@ -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;
}