aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Blott2015-09-11 05:22:37 +0100
committerStephen Blott2015-09-11 05:22:37 +0100
commit107ac51cad170d782fcf0fd87cc1587b5a132588 (patch)
tree2bfc0ab78a6f7db5558603a6b18681dbcdb63540
parent92052d5cb9d0f190c47d985d0e35ec1944483dab (diff)
parent8587fcd8ca019c94d685701412764205ede2124f (diff)
downloadvimium-107ac51cad170d782fcf0fd87cc1587b5a132588.tar.bz2
Merge pull request #1815 from smblott-github/fix-move-pinned-tab
Fix moveTab for pinned tabs.
-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