mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-04 10:49:08 +00:00
fix(scroll): check mousescroll before spamming
This commit is contained in:
parent
746f05cf3a
commit
3d67bda1e2
1 changed files with 8 additions and 8 deletions
|
@ -204,14 +204,6 @@ function M.check(win)
|
|||
stats.skipped = stats.skipped + 1
|
||||
state.current = vim.deepcopy(state.view)
|
||||
return
|
||||
elseif spamming and not (state.anim and state.anim.done) then
|
||||
-- just ignore the scroll when spamming and we're already animating
|
||||
stats.spamming = stats.spamming + 1
|
||||
stats.scrolls = stats.scrolls + 1
|
||||
vim.api.nvim_win_call(win, function()
|
||||
vim.fn.winrestview(state.current)
|
||||
end)
|
||||
return
|
||||
elseif mouse_scrolling then
|
||||
if state.anim then
|
||||
state.anim:stop()
|
||||
|
@ -222,6 +214,14 @@ function M.check(win)
|
|||
stats.mousescroll = stats.mousescroll + 1
|
||||
state.current = vim.deepcopy(state.view)
|
||||
return
|
||||
elseif spamming and not (state.anim and state.anim.done) then
|
||||
-- just ignore the scroll when spamming and we're already animating
|
||||
stats.spamming = stats.spamming + 1
|
||||
stats.scrolls = stats.scrolls + 1
|
||||
vim.api.nvim_win_call(win, function()
|
||||
vim.fn.winrestview(state.current)
|
||||
end)
|
||||
return
|
||||
end
|
||||
stats.scrolls = stats.scrolls + 1
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue