feat(textobjects): Add start to include preceding things like documentation

This commit is contained in:
Stephan Seitz 2020-07-15 19:32:41 +02:00 committed by Thomas Vigouroux
parent 31d1f068fd
commit b480d25155
4 changed files with 39 additions and 6 deletions

View file

@ -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('$')