diff options
author | teramako | 2011-10-29 13:06:44 +0900 |
---|---|---|
committer | teramako | 2011-10-29 13:06:44 +0900 |
commit | f3aa8e96b2d3a7a944e53e9f575563925ecbb4fb (patch) | |
tree | a3d60d06b928c27f051b5c6d366991698407317d | |
parent | 7e8f2eccb7a8da4ebc679620adda1680ff552bfd (diff) | |
download | vimperator-plugins-f3aa8e96b2d3a7a944e53e9f575563925ecbb4fb.tar.bz2 |
Fix: 同じタブが履歴上で連続してしまう
1. tab[1], tab[2], tab[1], tab[2] とタブを選択する
2. tab[2] を閉じると、 tab[1], tab[1] という履歴になる
-rw-r--r-- | tab-history.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tab-history.js b/tab-history.js index 1659e08..ff5b33b 100644 --- a/tab-history.js +++ b/tab-history.js @@ -66,6 +66,17 @@ var tabHistory = (function(){ if (i <= index) --index; } + + for (let i = 1; i < history.length; ++i) { + let prevTab = history[i - 1], + currentTab = history[i]; + + if (prevTab === currentTab) { + history.splice(i, 1); + if (i <= index) + --index; + } + } } function addHistory (aTab) { |