Skip to content

Commit ba7d8e7

Browse files
committed
Merge pull request #272 from airodactyl/obey-close-window-config
Obey browser.tabs.closeWindowWithLastTab
2 parents 81f7da6 + 8377dc8 commit ba7d8e7

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

common/content/tabs.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,14 +204,14 @@ const Tabs = Module("tabs", {
204204
* 1 - Focus the tab to the right of the remove tab.
205205
* 0 - Focus the altanate tab of the remove tab. if alternate tab is none, same as 1
206206
* -1 - Focus the tab to the left of the remove tab.
207-
* @param {number} quitOnLastTab Whether to quit if the tab being
207+
* @param {number} forceQuitOnLastTab Whether to quit if the tab being
208208
* deleted is the only tab in the tab list:
209209
* 1 - quit without saving session
210210
* 2 - quit and save session
211211
* @param {boolean} force Close even if the tab is an app tab.
212212
*/
213213
// FIXME: what is quitOnLastTab {1,2} all about then, eh? --djk
214-
remove: function (tab, count, orientation, quitOnLastTab, force) {
214+
remove: function (tab, count, orientation, forceQuitOnLastTab, force) {
215215
let vTabs = config.tabbrowser.visibleTabs;
216216
let removeOrBlankTab = {
217217
Firefox: function (tab) {
@@ -239,11 +239,14 @@ const Tabs = Module("tabs", {
239239
if (typeof count != "number" || count < 1)
240240
count = 1;
241241

242-
if (quitOnLastTab >= 1 && config.tabbrowser.mTabs.length <= count) {
242+
if (options.getPref("browser.tabs.closeWindowWithLastTab") && !forceQuitOnLastTab)
243+
forceQuitOnLastTab = 1;
244+
245+
if (forceQuitOnLastTab >= 1 && config.tabbrowser.mTabs.length <= count) {
243246
if (liberator.windows.length > 1)
244247
window.close();
245248
else
246-
liberator.quit(quitOnLastTab == 2);
249+
liberator.quit(forceQuitOnLastTab == 2);
247250

248251
return;
249252
}

vimperator/NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
201x-xx-xx:
22
* Stop propagation for keyboard event if that key are contained in -except option on :ignorekeys
33
* Improvements in handling Esc for unfocusing text fields
4+
* Closing the last tab of a window now respects the Firefox setting:
5+
browser.tabs.closeWindowWithLastTab, which means those who are used to :tabclose never closing
6+
the window when closing the last tab, should set this option to false (either through about:config
7+
or with :set! browser.tabs.closeWindowWithLastTab=false)
48

59
2015-08-25:
610
* Version 3.10.1

0 commit comments

Comments
 (0)