fix(scope): change from/to selection to make more sense

This commit is contained in:
Folke Lemaitre 2024-12-13 13:23:52 +01:00
parent 5200a8baa5
commit e8dd394c01
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -623,9 +623,9 @@ function M.textobject(opts)
local parent = scope:parent()
if not same or not parent then
-- select the range
vim.api.nvim_win_set_cursor(0, to)
vim.cmd("normal! " .. (opts.linewise and "V" or "v"))
vim.api.nvim_win_set_cursor(0, from)
vim.cmd("normal! " .. (opts.linewise and "V" or "v"))
vim.api.nvim_win_set_cursor(0, to)
return
end