Add only/co command
This commit is contained in:
parent
8fc12fea5f
commit
e6af8bb7ae
3
TODO
3
TODO
@ -284,9 +284,6 @@ Open quickmark in a new tab (command tab_quickmark, aliases: tabqmarks).
|
||||
tab-handling
|
||||
------------
|
||||
|
||||
co
|
||||
Close all tabs except for the current one (command only).
|
||||
|
||||
[n]T
|
||||
Focus nth tab, first tab if n is omitted or last tab if n is 0. (command focus_tab, aliases: tab).
|
||||
|
||||
|
@ -547,6 +547,7 @@ DATA = OrderedDict([
|
||||
('gO', 'tabopencur'),
|
||||
('ga', 'tabopen about:blank'),
|
||||
('d', 'tabclose'),
|
||||
('co', 'only'),
|
||||
('J', 'tabnext'),
|
||||
('K', 'tabprev'),
|
||||
('r', 'reload'),
|
||||
|
@ -248,6 +248,14 @@ class TabbedBrowser(TabWidget):
|
||||
elif last_close == 'blank':
|
||||
tab.openurl('about:blank')
|
||||
|
||||
@cmdutils.register(instance='mainwindow.tabs')
|
||||
def only(self):
|
||||
"""Close all tabs except for the current one."""
|
||||
for i in range(self.count() - 1):
|
||||
if i == self.currentIndex():
|
||||
continue
|
||||
self._close_tab(self.widget(i))
|
||||
|
||||
@cmdutils.register(instance='mainwindow.tabs', split=False, name='tabopen')
|
||||
def tabopen_cmd(self, url):
|
||||
"""Open a new tab with a given url."""
|
||||
|
Loading…
Reference in New Issue
Block a user