mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-02 19:46:58 -04:00
goto_node select last character when in operator-pending mode
This commit is contained in:
parent
53695580e3
commit
df968afd9d
1 changed files with 8 additions and 0 deletions
|
|
@ -452,6 +452,14 @@ function M.goto_node(node, goto_end, avoid_set_jump)
|
|||
else
|
||||
position = { range[3], range[4] }
|
||||
end
|
||||
|
||||
-- Enter visual mode if we are in operator pending mode
|
||||
-- If we don't do this, it will miss the last character.
|
||||
local mode = vim.api.nvim_get_mode()
|
||||
if mode.mode == "no" then
|
||||
vim.cmd "normal! v"
|
||||
end
|
||||
|
||||
-- Position is 1, 0 indexed.
|
||||
api.nvim_win_set_cursor(0, { position[1], position[2] - 1 })
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue