mirror of
https://github.com/folke/snacks.nvim
synced 2025-12-23 08:47:57 +00:00
fix(scroll): only reset count when needed
This commit is contained in:
parent
6a42a1d35f
commit
551d79f1c0
1 changed files with 5 additions and 3 deletions
|
|
@ -367,9 +367,11 @@ function M.check(win)
|
|||
vim.cmd(("keepjumps normal! %s"):format(table.concat(commands, "")))
|
||||
|
||||
-- restore count (see #1024)
|
||||
local cursor = vim.api.nvim_win_get_cursor(win)
|
||||
vim.cmd(("keepjumps normal! %dzh"):format(count))
|
||||
vim.api.nvim_win_set_cursor(win, cursor)
|
||||
if vim.v.count ~= count then
|
||||
local cursor = vim.api.nvim_win_get_cursor(win)
|
||||
vim.cmd(("keepjumps normal! %dzh"):format(count))
|
||||
vim.api.nvim_win_set_cursor(win, cursor)
|
||||
end
|
||||
|
||||
state:update()
|
||||
end)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue