parser: only use parse to get a tree

This will avoid using internal data.
This commit is contained in:
Thomas Vigouroux 2020-11-03 21:08:36 +01:00
parent f999dc4113
commit 6eca8d2f38
4 changed files with 4 additions and 4 deletions

View file

@ -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