From e514b0d58eeaf6f7de911ade7da0854c5c4a5769 Mon Sep 17 00:00:00 2001 From: thuck Date: Wed, 16 Nov 2016 08:18:08 +0100 Subject: [PATCH] Included --force option for tab-close This makes possible to close pinned tabs without any confirmation. --- qutebrowser/browser/commands.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/qutebrowser/browser/commands.py b/qutebrowser/browser/commands.py index 8dbe4fe86..567e45a9f 100644 --- a/qutebrowser/browser/commands.py +++ b/qutebrowser/browser/commands.py @@ -239,7 +239,8 @@ class CommandDispatcher: @cmdutils.register(instance='command-dispatcher', scope='window') @cmdutils.argument('count', count=True) - def tab_close(self, prev=False, next_=False, opposite=False, count=None): + def tab_close(self, prev=False, next_=False, opposite=False, + force=False, count=None): """Close the current/[count]th tab. Args: @@ -247,6 +248,7 @@ class CommandDispatcher: next_: Force selecting the tab after the current tab. opposite: Force selecting the tab in the opposite direction of what's configured in 'tabs->select-on-remove'. + force: Avoid confirmation for pinned tabs. count: The tab index to close, or None """ tab = self._cntwidget(count) @@ -255,7 +257,7 @@ class CommandDispatcher: close = functools.partial(self._tab_close, tab, prev, next_, opposite) - if tab.data.pinned: + if tab.data.pinned and not force: message.confirm_async(title='Pinned Tab', text="Are you sure you want to close a pinned tab?", yes_action=close, default=False)