Fix a bug where pinned tabs were occasionally miscounted
Example case: :tab-only. This should cover other cases, but currently those cases (such as :tab-only) do NOT have a warning message when popping up.
This commit is contained in:
parent
725bafea54
commit
3317834b36
@ -220,9 +220,6 @@ class CommandDispatcher:
|
|||||||
self._tabbed_browser.close_tab(tab)
|
self._tabbed_browser.close_tab(tab)
|
||||||
tabbar.setSelectionBehaviorOnRemove(old_selection_behavior)
|
tabbar.setSelectionBehaviorOnRemove(old_selection_behavior)
|
||||||
|
|
||||||
if tab.data.pinned:
|
|
||||||
tabbar.pinned_count -= 1
|
|
||||||
|
|
||||||
@cmdutils.register(instance='command-dispatcher', scope='window')
|
@cmdutils.register(instance='command-dispatcher', scope='window')
|
||||||
@cmdutils.argument('count', count=True)
|
@cmdutils.argument('count', count=True)
|
||||||
def tab_close(self, prev=False, next_=False, opposite=False,
|
def tab_close(self, prev=False, next_=False, opposite=False,
|
||||||
@ -241,12 +238,13 @@ class CommandDispatcher:
|
|||||||
if tab is None:
|
if tab is None:
|
||||||
return
|
return
|
||||||
close = functools.partial(self._tab_close, tab, prev,
|
close = functools.partial(self._tab_close, tab, prev,
|
||||||
next_, opposite)
|
next_, opposite)
|
||||||
|
|
||||||
if tab.data.pinned and not force:
|
if tab.data.pinned and not force:
|
||||||
message.confirm_async(title='Pinned Tab',
|
message.confirm_async(
|
||||||
text="Are you sure you want to close a pinned tab?",
|
title='Pinned Tab',
|
||||||
yes_action=close, default=False)
|
text="Are you sure you want to close a pinned tab?",
|
||||||
|
yes_action=close, default=False)
|
||||||
else:
|
else:
|
||||||
close()
|
close()
|
||||||
|
|
||||||
|
@ -241,6 +241,10 @@ class TabbedBrowser(tabwidget.TabWidget):
|
|||||||
if last_close == 'ignore' and count == 1:
|
if last_close == 'ignore' and count == 1:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# If we are removing a pinned tab, decrease count
|
||||||
|
if tab.data.pinned:
|
||||||
|
self.tabBar().pinned_count -= 1
|
||||||
|
|
||||||
self._remove_tab(tab, add_undo=add_undo)
|
self._remove_tab(tab, add_undo=add_undo)
|
||||||
|
|
||||||
if count == 1: # We just closed the last tab above.
|
if count == 1: # We just closed the last tab above.
|
||||||
|
@ -163,6 +163,7 @@ def clean_open_tabs(quteproc):
|
|||||||
quteproc.send_cmd(':tab-close --force')
|
quteproc.send_cmd(':tab-close --force')
|
||||||
quteproc.wait_for_load_finished_url('about:blank')
|
quteproc.wait_for_load_finished_url('about:blank')
|
||||||
|
|
||||||
|
|
||||||
@bdd.given('pdfjs is available')
|
@bdd.given('pdfjs is available')
|
||||||
def pdfjs_available():
|
def pdfjs_available():
|
||||||
if not pdfjs.is_available():
|
if not pdfjs.is_available():
|
||||||
|
Loading…
Reference in New Issue
Block a user