Change command from pin/unpin to tab-pin

This commit is contained in:
thuck 2016-11-06 23:24:24 +01:00
parent 6d7a6db130
commit d592651c50

View File

@ -247,28 +247,22 @@ class CommandDispatcher:
self._tabbed_browser.close_tab(tab) self._tabbed_browser.close_tab(tab)
tabbar.setSelectionBehaviorOnRemove(old_selection_behavior) tabbar.setSelectionBehaviorOnRemove(old_selection_behavior)
@cmdutils.register(instance='command-dispatcher', scope='window', name='pin') @cmdutils.register(instance='command-dispatcher', scope='window', name='tab-pin')
@cmdutils.argument('index') @cmdutils.argument('index')
@cmdutils.argument('count', count=True) @cmdutils.argument('count', count=True)
def tab_pin(self, index=1, count=None): def tab_pin(self, index=None, count=None):
tab = self._cntwidget(count) tab = self._cntwidget(count)
if tab is None: if tab is None:
return return
tab.pin = True
self.tab_move(int(index))
@cmdutils.register(instance='command-dispatcher', scope='window', name='unpin') tab.pin = not tab.pin
@cmdutils.argument('index')
@cmdutils.argument('count', count=True) if tab.pin is True:
def tab_unpin(self, index=None, count=None): index = 1 if index is None else int(index)
tab = self._cntwidget(count)
if tab is None:
return
tab.pin = False
if index is not None:
self.tab_move(int(index))
else: else:
self.tab_move(self._count()) index = self._count() if index is None else int(index)
self.tab_move(index)
@cmdutils.register(instance='command-dispatcher', name='open', @cmdutils.register(instance='command-dispatcher', name='open',
maxsplit=0, scope='window') maxsplit=0, scope='window')