diff options
| author | Stephen Blott | 2015-05-27 14:46:51 +0100 |
|---|---|---|
| committer | Stephen Blott | 2015-05-27 14:46:51 +0100 |
| commit | f16c7f270563cc79a7d7280d5a91ababc3be6965 (patch) | |
| tree | 9ea173a4d4ec649e09f3b078fa7de447fbfd40c2 /background_scripts/main.coffee | |
| parent | dffd14a93faf345f02c3c7a7def6b176ed5aeb7d (diff) | |
| download | vimium-f16c7f270563cc79a7d7280d5a91ababc3be6965.tar.bz2 | |
Simplify index calculation.
Diffstat (limited to 'background_scripts/main.coffee')
| -rw-r--r-- | background_scripts/main.coffee | 3 |
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) -> |
