aboutsummaryrefslogtreecommitdiffstats
path: root/background_scripts
diff options
context:
space:
mode:
authorStephen Blott2015-09-17 10:23:58 +0100
committerStephen Blott2015-09-17 10:24:01 +0100
commit37ba00af0e89641d0c54c19968c8986719eecde1 (patch)
treec01562510b74a366655c2136a0a8ecf08f1ba3b2 /background_scripts
parent44724013cf52ddbde999b3570175ef6e223f6b98 (diff)
downloadvimium-37ba00af0e89641d0c54c19968c8986719eecde1.tar.bz2
Fix regression in #1828.
In #1828, we (I) broke the fact that `gt` and `gT` should be able to wrap around at the ends (so, for example, `gt` on the right-most tab should take you to the first).
Diffstat (limited to 'background_scripts')
-rw-r--r--background_scripts/main.coffee4
1 files changed, 2 insertions, 2 deletions
diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee
index 511d24ac..df841028 100644
--- a/background_scripts/main.coffee
+++ b/background_scripts/main.coffee
@@ -349,9 +349,9 @@ selectTab = (direction, count = 1) ->
toSelect =
switch direction
when "next"
- Math.min tabs.length - 1, currentTab.index + count
+ (currentTab.index + count) % tabs.length
when "previous"
- Math.max 0, currentTab.index - count
+ (currentTab.index - count + count * tabs.length) % tabs.length
when "first"
Math.min tabs.length - 1, count - 1
when "last"