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)
|
||||
tabbar.setSelectionBehaviorOnRemove(old_selection_behavior)
|
||||
|
||||
if tab.data.pinned:
|
||||
tabbar.pinned_count -= 1
|
||||
|
||||
@cmdutils.register(instance='command-dispatcher', scope='window')
|
||||
@cmdutils.argument('count', count=True)
|
||||
def tab_close(self, prev=False, next_=False, opposite=False,
|
||||
@ -244,7 +241,8 @@ class CommandDispatcher:
|
||||
next_, opposite)
|
||||
|
||||
if tab.data.pinned and not force:
|
||||
message.confirm_async(title='Pinned Tab',
|
||||
message.confirm_async(
|
||||
title='Pinned Tab',
|
||||
text="Are you sure you want to close a pinned tab?",
|
||||
yes_action=close, default=False)
|
||||
else:
|
||||
|
@ -241,6 +241,10 @@ class TabbedBrowser(tabwidget.TabWidget):
|
||||
if last_close == 'ignore' and count == 1:
|
||||
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)
|
||||
|
||||
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.wait_for_load_finished_url('about:blank')
|
||||
|
||||
|
||||
@bdd.given('pdfjs is available')
|
||||
def pdfjs_available():
|
||||
if not pdfjs.is_available():
|
||||
|
Loading…
Reference in New Issue
Block a user