aboutsummaryrefslogtreecommitdiffstats
path: root/content_scripts
diff options
context:
space:
mode:
authorStephen Blott2016-02-28 10:07:19 +0000
committerStephen Blott2016-02-28 10:07:19 +0000
commitff6dee4a3f5d49ae4ea7ae037f6e0df78b65eb31 (patch)
tree9e6872a4cfecac459e2a06365b82c0fa1de62745 /content_scripts
parentf6a3bc3aa0c14af41a9b6035cc809071b4a27af1 (diff)
downloadvimium-ff6dee4a3f5d49ae4ea7ae037f6e0df78b65eb31.tar.bz2
Pass to count to scroll commands.
Currently, `10j` keeping `j` held down scrolls quickly for a time then reduces back the regular hold-`j` scroll speed. Therefore, the user cannot use a count to influence the smooth-scrolling scroll speed. This PR fixes that by passing the count to the scroll functions. Consequently, we adjust the actual scroll amount (which affects the scroll speed) rather than calling the scroll commands several times (which doesn't).
Diffstat (limited to 'content_scripts')
-rw-r--r--content_scripts/vimium_frontend.coffee16
1 files changed, 8 insertions, 8 deletions
diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee
index 4cebf4e4..3d05e8c4 100644
--- a/content_scripts/vimium_frontend.coffee
+++ b/content_scripts/vimium_frontend.coffee
@@ -312,14 +312,14 @@ extend window,
Scroller.scrollTo "y", (count - 1) * Settings.get("scrollStepSize")
scrollToLeft: -> Scroller.scrollTo "x", 0
scrollToRight: -> Scroller.scrollTo "x", "max"
- scrollUp: -> Scroller.scrollBy "y", -1 * Settings.get("scrollStepSize")
- scrollDown: -> Scroller.scrollBy "y", Settings.get("scrollStepSize")
- scrollPageUp: -> Scroller.scrollBy "y", "viewSize", -1/2
- scrollPageDown: -> Scroller.scrollBy "y", "viewSize", 1/2
- scrollFullPageUp: -> Scroller.scrollBy "y", "viewSize", -1
- scrollFullPageDown: -> Scroller.scrollBy "y", "viewSize"
- scrollLeft: -> Scroller.scrollBy "x", -1 * Settings.get("scrollStepSize")
- scrollRight: -> Scroller.scrollBy "x", Settings.get("scrollStepSize")
+ scrollUp: (count) -> Scroller.scrollBy "y", -1 * Settings.get("scrollStepSize") * count
+ scrollDown: (count) -> Scroller.scrollBy "y", Settings.get("scrollStepSize") * count
+ scrollPageUp: (count) -> Scroller.scrollBy "y", "viewSize", -1/2 * count
+ scrollPageDown: (count) -> Scroller.scrollBy "y", "viewSize", 1/2 * count
+ scrollFullPageUp: (count) -> Scroller.scrollBy "y", "viewSize", -1 * count
+ scrollFullPageDown: (count) -> Scroller.scrollBy "y", "viewSize", 1 * count
+ scrollLeft: (count) -> Scroller.scrollBy "x", -1 * Settings.get("scrollStepSize") * count
+ scrollRight: (count) -> Scroller.scrollBy "x", Settings.get("scrollStepSize") * count
extend window,
reload: -> window.location.reload()