diff options
| author | int3 | 2010-04-03 02:30:58 +0800 |
|---|---|---|
| committer | ilya | 2010-04-10 19:22:42 -0700 |
| commit | bdd0690bd478828a2d049c8177b2290b376f22ee (patch) | |
| tree | 735e48fa6346199531dee3d02d49936d8a1b8118 /background_page.html | |
| parent | 7f87e2031be72d8e1cc04056d26590181e18778b (diff) | |
| download | vimium-bdd0690bd478828a2d049c8177b2290b376f22ee.tar.bz2 | |
Maintain accurate tab indices while ignoring chrome://newtab
Diffstat (limited to 'background_page.html')
| -rw-r--r-- | background_page.html | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/background_page.html b/background_page.html index da803e99..0aeb2a25 100644 --- a/background_page.html +++ b/background_page.html @@ -341,7 +341,14 @@ if (!openTabInfo) { return; } // This tab might've been opened before the extension was installed. // If we restore the new tab page, it'll ignore Vimium keystrokes when it reappears. - if (openTabInfo.url == "chrome://newtab/") { return; } + // Pretend it never existed and adjust tab indices accordingly. + if (openTabInfo.url == "chrome://newtab/") { + for (var i in tabQueue[openTabInfo.windowId]) { + if (tabQueue[openTabInfo.windowId][i].positionIndex > openTabInfo.positionIndex) { + tabQueue[openTabInfo.windowId][i].positionIndex--; + } + } + } if (tabQueue[openTabInfo.windowId]) tabQueue[openTabInfo.windowId].push(openTabInfo); |
