yuttie / comfortable-motion.vim

Brings physics-based smooth scrolling to the Vim world!
MIT License
634 stars 19 forks source link

Adjust timer use to alleviate flicker on scroll up #20

Closed amarqueslee closed 6 years ago

amarqueslee commented 6 years ago

I reworked the timer logic to have one timer running constantly running against the physics state. I believe that doing so reduces overheads/delays caused by repeatedly scheduling callbacks as in the original code. To keep the timer overhead light, the callback function is modified to short-circuit in cases where scrolling is not expected to take place.

On my machine, this resolves issue #17 (bad flickering scrolling up), which I experienced with vim in xterm ($TERM set to xterm-256color). I'd be interested to see feedback from others.

By the way, thanks for the cool plugin!