mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-22 09:26:19 +04:00
ignore empty TS nodes in match bracket
This commit is contained in:
parent
2fb7e50b54
commit
445f7a273a
@ -60,7 +60,7 @@ fn find_pair(
|
|||||||
let tree = syntax.tree();
|
let tree = syntax.tree();
|
||||||
let pos = doc.char_to_byte(pos_);
|
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 {
|
loop {
|
||||||
if node.is_named() {
|
if node.is_named() {
|
||||||
@ -118,7 +118,9 @@ fn find_pair(
|
|||||||
};
|
};
|
||||||
node = parent;
|
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 {
|
if node.child_count() != 0 {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user