fix(scroll): don't animate scroll distance 1

This commit is contained in:
Folke Lemaitre 2024-12-12 18:12:33 +01:00
parent 8a98e92dc5
commit a986851a74
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -189,7 +189,7 @@ function M.check(win)
-- if delta is 0, then we're animating.
-- also skip if the difference is less than the mousescroll value,
-- since most terminals support smooth mouse scrolling.
if state.view.topline == state.current.topline then
if math.abs(state.view.topline - state.current.topline) <= 1 then
stats.skipped = stats.skipped + 1
state.current = vim.deepcopy(state.view)
return