From eaafbbeeab7181ae1d3da3aa9495f98b593798f9 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Sat, 20 Feb 2016 16:40:30 +0000 Subject: Fix `removeTab`. There's a nasty little bug in `removeTab` when you remove more tabs than there are in the window (and there is a second window): - all of the tabs in the currently-focused window are removed - then, later (so, time passes), when you change tab in the other window, we begin removing tabs again! The source of the bug is our reliance on `chrome.tabs.onSelectionChanged`, which doesn't first when removing the last tab in a window (and there is another window). Regardless, the previous semantics of `removeTab` was questionable. It was preactically impossible to predict which tabs would removed. This picks the current tab, then those to the right of the current tab, then those to the left. --- background_scripts/commands.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'background_scripts/commands.coffee') diff --git a/background_scripts/commands.coffee b/background_scripts/commands.coffee index 01eecd81..fbecc8f0 100644 --- a/background_scripts/commands.coffee +++ b/background_scripts/commands.coffee @@ -339,7 +339,7 @@ commandDescriptions = createTab: ["Create new tab", { background: true, repeatLimit: 20 }] duplicateTab: ["Duplicate current tab", { background: true, repeatLimit: 20 }] - removeTab: ["Close current tab", { background: true, repeatLimit: + removeTab: ["Close current tab", { background: true, passCountToFunction: true, repeatLimit: # Require confirmation to remove more tabs than we can restore. (if chrome.session then chrome.session.MAX_SESSION_RESULTS else 25) }] restoreTab: ["Restore closed tab", { background: true, repeatLimit: 20 }] -- cgit v1.2.3