diff options
| -rw-r--r-- | lua/nvim-treesitter/ts_utils.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lua/nvim-treesitter/ts_utils.lua b/lua/nvim-treesitter/ts_utils.lua index b3f468934..655c62881 100644 --- a/lua/nvim-treesitter/ts_utils.lua +++ b/lua/nvim-treesitter/ts_utils.lua @@ -173,7 +173,7 @@ function M.get_node_at_cursor(winnr, ignore_injected_langs) local root ---@type TSNode|nil if ignore_injected_langs then - for _, tree in ipairs(root_lang_tree:trees()) do + for _, tree in pairs(root_lang_tree:trees()) do local tree_root = tree:root() if tree_root and ts.is_in_node_range(tree_root, cursor_range[1], cursor_range[2]) then root = tree_root @@ -202,7 +202,7 @@ function M.get_root_for_position(line, col, root_lang_tree) local lang_tree = root_lang_tree:language_for_range { line, col, line, col } - for _, tree in ipairs(lang_tree:trees()) do + for _, tree in pairs(lang_tree:trees()) do local root = tree:root() if root and ts.is_in_node_range(root, line, col) then |
