aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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