From cce9948c1c55782153c338f18000eee66dc9f22e Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Sun, 22 Sep 2019 00:02:16 +0100 Subject: [PATCH] CTRL+backspace now jumps to prev sel tab --- lib/ice-coder.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/lib/ice-coder.js b/lib/ice-coder.js index a16619a..89beda2 100644 --- a/lib/ice-coder.js +++ b/lib/ice-coder.js @@ -42,6 +42,7 @@ var ICEcoder = { tabFGopenFile: '#000', // FG of open file tabFGnormalFile: '#eee', // FG of normal file tabFGnormalTab: '#888', // FG of normal tab + prevTab: 0, // Previous tab to current serverQueueItems: [], // Array of URLs to call in order miniMapBoxTop: 0, // Top of the minimap box highlighter miniMapBoxHeight: 0, // Height of the minimap box highlighter @@ -3755,6 +3756,11 @@ var ICEcoder = { switchTab: function(newTab,noFocus) { var cM, cMdiff, thisCM; + // If we're not switching to same tab (for some reason), note the previous tab + if (newTab !== top.ICEcoder.selectedTab) { + top.ICEcoder.prevTab = top.ICEcoder.selectedTab; + } + // Identify tab that's currently selected & get the instance ICEcoder.selectedTab = newTab; cM = ICEcoder.getcMInstance(); @@ -4373,12 +4379,19 @@ var ICEcoder = { top.ICEcoder.searchForSelected(); return false; - // CTRL/Cmd+right arrow (Next tab) + // CTRL/Cmd+backspace arrow (Go to previous tab selected) + } else if(key==8 && (evt.ctrlKey||top.ICEcoder.cmdKey)) { + if (top.ICEcoder.prevTab !== 0) { + top.ICEcoder.switchTab(top.ICEcoder.prevTab); + } + return false; + + // CTRL/Cmd+right arrow (Tab to right) } else if(key==39 && (evt.ctrlKey||top.ICEcoder.cmdKey) && area!="content") { top.ICEcoder.nextTab(); return false; - // CTRL/Cmd+left arrow (Previous tab) + // CTRL/Cmd+left arrow (Tab to left) } else if(key==37 && (evt.ctrlKey||top.ICEcoder.cmdKey) && area!="content") { top.ICEcoder.previousTab(); return false;