mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
fix decremental selection
This commit is contained in:
parent
5c5f4c5d54
commit
a855538e0a
1 changed files with 6 additions and 1 deletions
|
|
@ -55,13 +55,18 @@ local function select_incremental(get_parent)
|
|||
local root = parsers.get_parser().tree:root()
|
||||
local node = root:named_descendant_for_range(csrow, cscol, cerow, cecol)
|
||||
ts_utils.update_selection(buf, node)
|
||||
selections[buf] = { [1] = node }
|
||||
if nodes and #nodes > 0 then
|
||||
table.insert(selections[buf], node)
|
||||
else
|
||||
selections[buf] = { [1] = node }
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
local node = get_parent(nodes[#nodes])
|
||||
if not node then return end
|
||||
|
||||
table.insert(selections[buf], node)
|
||||
if node ~= nodes[#nodes] then
|
||||
table.insert(nodes, node)
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue