From 6eca8d2f3860e7d76b0b524877c13206c2900b01 Mon Sep 17 00:00:00 2001 From: Thomas Vigouroux Date: Tue, 3 Nov 2020 21:08:36 +0100 Subject: parser: only use parse to get a tree This will avoid using internal data. --- lua/nvim-treesitter/incremental_selection.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lua/nvim-treesitter/incremental_selection.lua') diff --git a/lua/nvim-treesitter/incremental_selection.lua b/lua/nvim-treesitter/incremental_selection.lua index e40cc13c..8f59fe4a 100644 --- a/lua/nvim-treesitter/incremental_selection.lua +++ b/lua/nvim-treesitter/incremental_selection.lua @@ -43,7 +43,7 @@ local function select_incremental(get_parent) local csrow, cscol, cerow, cecol = visual_selection_range() -- Initialize incremental selection with current selection if not nodes or #nodes == 0 or not range_matches(nodes[#nodes]) then - local root = parsers.get_parser().tree:root() + local root = parsers.get_parser():parse():root() local node = root:named_descendant_for_range(csrow, cscol, cerow, cecol) ts_utils.update_selection(buf, node) if nodes and #nodes > 0 then -- cgit v1.2.3