mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 19:38:20 +00:00
perf(snippet): use "[count]|" to move cursor #33571
Problem:
Flicker when using vim.snippet.jump().
Solution:
Pass count instead of multiple <right> keys.
(cherry picked from commit d3e495ce03
)
This commit is contained in:

committed by
github-actions[bot]
![github-actions[bot]](/assets/img/avatar_default.png)
parent
fb71d631a5
commit
b9c9b15ad7
@@ -284,9 +284,7 @@ local function select_tabstop(tabstop)
|
|||||||
--- @param row integer
|
--- @param row integer
|
||||||
--- @param col integer
|
--- @param col integer
|
||||||
local function move_cursor_to(row, col)
|
local function move_cursor_to(row, col)
|
||||||
local line = vim.fn.getline(row) --[[ @as string ]]
|
feedkeys(string.format('%sG%s|', row, col))
|
||||||
col = math.max(vim.fn.strchars(line:sub(1, col)) - 1, 0)
|
|
||||||
feedkeys(string.format('%sG0%s', row, string.rep('<Right>', col)))
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local range = tabstop:get_range()
|
local range = tabstop:get_range()
|
||||||
|
Reference in New Issue
Block a user