Open fishstik opened 9 months ago
Interesting, but it must be as option. And need smooth when spam j or k. (Fast image draft below)
Um, now the scrolling has been somehow "smooth".
Some years ago Vimium C used a same strategy to scroll smoothly just like Vimium, but the code worked badly on a screen of > 60 fps
. So I modified the code for many times and finally created such a mess...
However the keypoint feature is always kept - it computes a target speed and gets nearer and nearer to the speed when you hold on a key, whether or not the target speed is faster or slower than a first speed.
If you think Vimium C scrools too slow on scrollPageDown
, you may use "count prefix" to obviously increase the target speed - for example, 3j
is much faster than a plain j
.
Basically I'm satisfied with the current "smooth scrolling" logic, because I think:
scrollToBottom
), I may type "count prefix" to achieve this effectTherefore, I may not implement such a "steep" ease-in/out
effect.
Ok, I think scrolling is good. @fishstik, you can close issue.
Would be great to add some easing to the smooth scroll to make it visually smoother, like in chromium-vim:
chromium-vim scrollPageDown/Up vimium scrollPageDown/Up
chromium-vim scrollToTop/Bottom vimium scrollToTop/Bottom
chromium-vim's implementation: https://github.com/1995eaton/chromium-vim/blob/60567d650c430e46ee894f8ea6b224bc48805aa5/content_scripts/scroll.js#L96-L98
I am guessing this delta calculation can be changed to implement this: https://github.com/gdh1995/vimium-c/blob/d470de4159e1d8ec16f2683484927534c1ba0b1b/content/scroller.ts#L165-L168