aboutsummaryrefslogtreecommitdiffstats
path: root/tab-history.js
diff options
context:
space:
mode:
authorteramako2011-10-29 13:06:44 +0900
committerteramako2011-10-29 13:06:44 +0900
commitf3aa8e96b2d3a7a944e53e9f575563925ecbb4fb (patch)
treea3d60d06b928c27f051b5c6d366991698407317d /tab-history.js
parent7e8f2eccb7a8da4ebc679620adda1680ff552bfd (diff)
downloadvimperator-plugins-f3aa8e96b2d3a7a944e53e9f575563925ecbb4fb.tar.bz2
Fix: 同じタブが履歴上で連続してしまう
1. tab[1], tab[2], tab[1], tab[2] とタブを選択する 2. tab[2] を閉じると、 tab[1], tab[1] という履歴になる
Diffstat (limited to 'tab-history.js')
-rw-r--r--tab-history.js11
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) {