Add tab/window support to :help
This commit is contained in:
parent
9281fa3992
commit
ecd31a6450
@ -822,10 +822,13 @@ class CommandDispatcher:
|
|||||||
@cmdutils.register(instance='command-dispatcher', name='help',
|
@cmdutils.register(instance='command-dispatcher', name='help',
|
||||||
completion=[usertypes.Completion.helptopic],
|
completion=[usertypes.Completion.helptopic],
|
||||||
scope='window')
|
scope='window')
|
||||||
def show_help(self, topic=None):
|
def show_help(self, tab=False, bg=False, window=False, topic=None):
|
||||||
r"""Show help about a command or setting.
|
r"""Show help about a command or setting.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
|
tab: Open in a new tab.
|
||||||
|
bg: Open in a background tab.
|
||||||
|
window: Open in a new window.
|
||||||
topic: The topic to show help for.
|
topic: The topic to show help for.
|
||||||
|
|
||||||
- :__command__ for commands.
|
- :__command__ for commands.
|
||||||
@ -855,7 +858,8 @@ class CommandDispatcher:
|
|||||||
path = 'settings.html#{}'.format(topic.replace('->', '-'))
|
path = 'settings.html#{}'.format(topic.replace('->', '-'))
|
||||||
else:
|
else:
|
||||||
raise cmdexc.CommandError("Invalid help topic {}!".format(topic))
|
raise cmdexc.CommandError("Invalid help topic {}!".format(topic))
|
||||||
self.openurl('qute://help/{}'.format(path))
|
url = QUrl('qute://help/{}'.format(path))
|
||||||
|
self._open(url, tab, bg, window)
|
||||||
|
|
||||||
@cmdutils.register(instance='command-dispatcher',
|
@cmdutils.register(instance='command-dispatcher',
|
||||||
modes=[usertypes.KeyMode.insert],
|
modes=[usertypes.KeyMode.insert],
|
||||||
|
Loading…
Reference in New Issue
Block a user