fix: check if tree-sitter Node.getParent() returns a null node in expand_selection
closes #360
This commit is contained in:
parent
0f7a4f25e4
commit
9a961c8dd2
1 changed files with 2 additions and 0 deletions
|
|
@ -4363,6 +4363,8 @@ pub const Editor = struct {
|
|||
while (parent_sel.eql(node_sel)) {
|
||||
node = parent;
|
||||
parent = parent.getParent();
|
||||
if (parent.tree == null)
|
||||
return node;
|
||||
parent_sel = CurSel.selection_from_node(parent, root, metrics) catch return node;
|
||||
}
|
||||
return node;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue