You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have already offered some work to improve our use of timers in this plugin as part of issue #17 . @yuttie has kindly suggested some additional changes which I agree would offer further improvement.
His relevant notes from the referenced issue:
We need to improve the other change for another issue of this plugin.
Thanks to your patch, I found that my original code redundantly starts a new tick thread whenever comfortable_motion#flick() is called, which causes unnatural acceleration.
The second change actually fixes the problem by maintaining only a single persistent tick thread.
However, it also introduces constant CPU usage even when a user doesn't use a vim.
I think we can improve the patch by stopping a tick thread when it is not needed.
This problem should be discussed in another issue.
My initial idea of how to approach this is to retain a single script-wide reference to a tick thread (represented by a timer ID), initially not started. If comfortable_motion#flick() is called when the thread is stopped, we will start the thread (call timer_start). If comfortable_motion#tick() is called and it discovers that scrolling has stopped, it will stop the thread with timer_stop.
@yuttie, does this approach seem appropriate to you?
The text was updated successfully, but these errors were encountered:
I have already offered some work to improve our use of timers in this plugin as part of issue #17 . @yuttie has kindly suggested some additional changes which I agree would offer further improvement.
His relevant notes from the referenced issue:
My initial idea of how to approach this is to retain a single script-wide reference to a tick thread (represented by a timer ID), initially not started. If
comfortable_motion#flick()
is called when the thread is stopped, we will start the thread (calltimer_start
). Ifcomfortable_motion#tick()
is called and it discovers that scrolling has stopped, it will stop the thread withtimer_stop
.@yuttie, does this approach seem appropriate to you?
The text was updated successfully, but these errors were encountered: