mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 03:18:16 +00:00
fix(treesitter): correct condition in __has_ancestor
This commit is contained in:

committed by
Lewis Russell

parent
a9e725b26e
commit
7a20f93a92
@@ -1151,7 +1151,7 @@ static int __has_ancestor(lua_State *L)
|
|||||||
int const pred_len = (int)lua_objlen(L, 2);
|
int const pred_len = (int)lua_objlen(L, 2);
|
||||||
|
|
||||||
TSNode node = ts_tree_root_node(descendant.tree);
|
TSNode node = ts_tree_root_node(descendant.tree);
|
||||||
while (node.id != descendant.id) {
|
while (node.id != descendant.id && !ts_node_is_null(node)) {
|
||||||
char const *node_type = ts_node_type(node);
|
char const *node_type = ts_node_type(node);
|
||||||
size_t node_type_len = strlen(node_type);
|
size_t node_type_len = strlen(node_type);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user