aboutsummaryrefslogtreecommitdiffstats
path: root/background_scripts
diff options
context:
space:
mode:
authorStephen Blott2015-09-11 04:58:31 +0100
committerStephen Blott2015-09-11 04:58:31 +0100
commit8587fcd8ca019c94d685701412764205ede2124f (patch)
tree2bfc0ab78a6f7db5558603a6b18681dbcdb63540 /background_scripts
parent92052d5cb9d0f190c47d985d0e35ec1944483dab (diff)
downloadvimium-8587fcd8ca019c94d685701412764205ede2124f.tar.bz2
Fix moveTab for pinned tabs.
Fixes #1814. (This fixes a problem that was introduced in the "fix" of #1727.)
Diffstat (limited to 'background_scripts')
-rw-r--r--background_scripts/main.coffee4
1 files changed, 3 insertions, 1 deletions
diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee
index 40d570ee..1a49c3cb 100644
--- a/background_scripts/main.coffee
+++ b/background_scripts/main.coffee
@@ -239,8 +239,10 @@ moveTab = (count) ->
chrome.tabs.getAllInWindow null, (tabs) ->
pinnedCount = (tabs.filter (tab) -> tab.pinned).length
chrome.tabs.getSelected null, (tab) ->
+ minIndex = if tab.pinned then 0 else pinnedCount
+ maxIndex = (if tab.pinned then pinnedCount else tabs.length) - 1
chrome.tabs.move tab.id,
- index: Math.max pinnedCount, Math.min tabs.length - 1, tab.index + count
+ index: Math.max minIndex, Math.min maxIndex, tab.index + count
# Start action functions