diff options
| author | Stephen Blott | 2015-09-11 04:58:31 +0100 | 
|---|---|---|
| committer | Stephen Blott | 2015-09-11 04:58:31 +0100 | 
| commit | 8587fcd8ca019c94d685701412764205ede2124f (patch) | |
| tree | 2bfc0ab78a6f7db5558603a6b18681dbcdb63540 | |
| parent | 92052d5cb9d0f190c47d985d0e35ec1944483dab (diff) | |
| download | vimium-8587fcd8ca019c94d685701412764205ede2124f.tar.bz2 | |
Fix moveTab for pinned tabs.
Fixes #1814.
(This fixes a problem that was introduced in the "fix" of #1727.)
| -rw-r--r-- | background_scripts/main.coffee | 4 | 
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 | 
