Don't automatically hide singleton nodes
This commit is contained in:
parent
acf9280eda
commit
53926c467e
21 changed files with 4284 additions and 4221 deletions
|
|
@ -63,8 +63,8 @@ void ts_document_set_input_string(TSDocument *document, const char *text) {
|
|||
}
|
||||
|
||||
TSNode ts_document_root_node(const TSDocument *document) {
|
||||
TSTree *tree = document->tree;
|
||||
while (tree && ts_tree_is_singleton(tree))
|
||||
tree = tree->children[0];
|
||||
return ts_node_make(tree, ts_length_zero());
|
||||
TSNode result = ts_node_make(document->tree, ts_length_zero());
|
||||
while (result.data && !ts_tree_is_visible(result.data))
|
||||
result = ts_node_child(result, 0);
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue