Merge 6e6083caf2 into 7e3df43463
This commit is contained in:
commit
a58fd472d7
|
|
@ -1519,7 +1519,7 @@ How many tabs to switch back.
|
||||||
|
|
||||||
[[tab-select]]
|
[[tab-select]]
|
||||||
=== tab-select
|
=== tab-select
|
||||||
Syntax: +:tab-select ['index']+
|
Syntax: +:tab-select [*--open*] ['index']+
|
||||||
|
|
||||||
Select tab by index or url/title best match.
|
Select tab by index or url/title best match.
|
||||||
|
|
||||||
|
|
@ -1528,6 +1528,8 @@ Focuses window if necessary when index is given. If both index and count are giv
|
||||||
==== positional arguments
|
==== positional arguments
|
||||||
* +'index'+: The [win_id/]index of the tab to focus. Or a substring in which case the closest match will be focused.
|
* +'index'+: The [win_id/]index of the tab to focus. Or a substring in which case the closest match will be focused.
|
||||||
|
|
||||||
|
==== optional arguments
|
||||||
|
* +*-o*+, +*--open*+: If index is a substring and it didn't match any tab, open it in a new tab.
|
||||||
|
|
||||||
==== count
|
==== count
|
||||||
The tab index to focus, starting with 1.
|
The tab index to focus, starting with 1.
|
||||||
|
|
|
||||||
|
|
@ -945,7 +945,7 @@ class CommandDispatcher:
|
||||||
maxsplit=0)
|
maxsplit=0)
|
||||||
@cmdutils.argument('index', completion=miscmodels.tabs)
|
@cmdutils.argument('index', completion=miscmodels.tabs)
|
||||||
@cmdutils.argument('count', value=cmdutils.Value.count)
|
@cmdutils.argument('count', value=cmdutils.Value.count)
|
||||||
def tab_select(self, index=None, count=None):
|
def tab_select(self, index=None, new=False, count=None):
|
||||||
"""Select tab by index or url/title best match.
|
"""Select tab by index or url/title best match.
|
||||||
|
|
||||||
Focuses window if necessary when index is given. If both index and
|
Focuses window if necessary when index is given. If both index and
|
||||||
|
|
@ -957,6 +957,7 @@ class CommandDispatcher:
|
||||||
index: The [win_id/]index of the tab to focus. Or a substring
|
index: The [win_id/]index of the tab to focus. Or a substring
|
||||||
in which case the closest match will be focused.
|
in which case the closest match will be focused.
|
||||||
count: The tab index to focus, starting with 1.
|
count: The tab index to focus, starting with 1.
|
||||||
|
open: If index is a substring and it didn't match any tab, open it in a new tab.
|
||||||
"""
|
"""
|
||||||
if count is None and index is None:
|
if count is None and index is None:
|
||||||
self.openurl('qute://tabs/', tab=True)
|
self.openurl('qute://tabs/', tab=True)
|
||||||
|
|
@ -965,7 +966,14 @@ class CommandDispatcher:
|
||||||
if count is not None:
|
if count is not None:
|
||||||
index = str(count)
|
index = str(count)
|
||||||
|
|
||||||
tabbed_browser, tab = self._resolve_tab_index(index)
|
tabbed_browser, tab = None, None
|
||||||
|
try:
|
||||||
|
tabbed_browser, tab = self._resolve_tab_index(index)
|
||||||
|
except cmdutils.CommandError:
|
||||||
|
if new:
|
||||||
|
self.openurl(index, tab=True)
|
||||||
|
return
|
||||||
|
raise
|
||||||
|
|
||||||
window = tabbed_browser.widget.window()
|
window = tabbed_browser.widget.window()
|
||||||
mainwindow.raise_window(window)
|
mainwindow.raise_window(window)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue