mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-02 03:26:52 -04:00
feat(textobjects): Add start to include preceding things like documentation
This commit is contained in:
parent
31d1f068fd
commit
b480d25155
4 changed files with 39 additions and 6 deletions
|
|
@ -325,7 +325,12 @@ end
|
|||
|
||||
-- Set visual selection to node
|
||||
function M.update_selection(buf, node)
|
||||
local start_row, start_col, end_row, end_col = node:range()
|
||||
local start_row, start_col, end_row, end_col
|
||||
if type(node) == 'table' then
|
||||
start_row, start_col, end_row, end_col = unpack(node)
|
||||
else
|
||||
start_row, start_col, end_row, end_col = node:range()
|
||||
end
|
||||
|
||||
if end_row == vim.fn.line('$') then
|
||||
end_col = #vim.fn.getline('$')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue