aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Blott2015-05-27 14:46:51 +0100
committerStephen Blott2015-05-27 14:46:51 +0100
commitf16c7f270563cc79a7d7280d5a91ababc3be6965 (patch)
tree9ea173a4d4ec649e09f3b078fa7de447fbfd40c2
parentdffd14a93faf345f02c3c7a7def6b176ed5aeb7d (diff)
downloadvimium-f16c7f270563cc79a7d7280d5a91ababc3be6965.tar.bz2
Simplify index calculation.
-rw-r--r--background_scripts/main.coffee3
1 files changed, 1 insertions, 2 deletions
diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee
index d4ba7850..a13d9d98 100644
--- a/background_scripts/main.coffee
+++ b/background_scripts/main.coffee
@@ -360,8 +360,7 @@ selectTab = (direction, count = 1) ->
when "last"
tabs.length - 1
# Bring toSelect into the range [0,tabs.length).
- toSelect += tabs.length while toSelect < 0
- toSelect %= tabs.length
+ toSelect = (toSelect + tabs.length * Math.abs count) % tabs.length
chrome.tabs.update tabs[toSelect].id, selected: true
updateOpenTabs = (tab, deleteFrames = false) ->