From 9ad3e09c79a05672b37573db651e98d083dc5f7c Mon Sep 17 00:00:00 2001 From: scde Date: Tue, 4 Dec 2018 12:55:56 +0100 Subject: [PATCH] Reapply PR #1150 "Only cycle through visible tabs" It seems the actual change in PR #1150 (a09a771) has been lost in its merge (6562699). This should now actually fix Issue #1084 and ignore hidden tabs when cycling through tabs. --- src/excmds.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/excmds.ts b/src/excmds.ts index e6b35261..d5459b42 100644 --- a/src/excmds.ts +++ b/src/excmds.ts @@ -1704,7 +1704,7 @@ export async function tabprev(increment = 1) { // Proper way: // return tabIndexSetActive((await activeTab()).index - increment + 1) // Kludge until https://bugzilla.mozilla.org/show_bug.cgi?id=1504775 is fixed: - return browser.tabs.query({ currentWindow: true }).then(tabs => { + return browser.tabs.query({ currentWindow: true, hidden: false }).then(tabs => { tabs = tabs.sort((t1, t2) => t1.index - t2.index) let prevTab = (tabs.findIndex(t => t.active) - increment + tabs.length) % tabs.length return browser.tabs.update(tabs[prevTab].id, { active: true })