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
|
tab-handling
|
||||||
------------
|
------------
|
||||||
|
|
||||||
co
|
|
||||||
Close all tabs except for the current one (command only).
|
|
||||||
|
|
||||||
[n]T
|
[n]T
|
||||||
Focus nth tab, first tab if n is omitted or last tab if n is 0. (command focus_tab, aliases: tab).
|
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'),
|
('gO', 'tabopencur'),
|
||||||
('ga', 'tabopen about:blank'),
|
('ga', 'tabopen about:blank'),
|
||||||
('d', 'tabclose'),
|
('d', 'tabclose'),
|
||||||
|
('co', 'only'),
|
||||||
('J', 'tabnext'),
|
('J', 'tabnext'),
|
||||||
('K', 'tabprev'),
|
('K', 'tabprev'),
|
||||||
('r', 'reload'),
|
('r', 'reload'),
|
||||||
|
@ -248,6 +248,14 @@ class TabbedBrowser(TabWidget):
|
|||||||
elif last_close == 'blank':
|
elif last_close == 'blank':
|
||||||
tab.openurl('about: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')
|
@cmdutils.register(instance='mainwindow.tabs', split=False, name='tabopen')
|
||||||
def tabopen_cmd(self, url):
|
def tabopen_cmd(self, url):
|
||||||
"""Open a new tab with a given url."""
|
"""Open a new tab with a given url."""
|
||||||
|
Loading…
Reference in New Issue
Block a user