Document no_replace_variables, misc fixes
Add no_replace_variables to the asciidoc, improve its description in the decorator, remove now unnecessary argument parsing in set-cmd-text
This commit is contained in:
parent
c7c5a98506
commit
827de1743d
@ -111,6 +111,7 @@ Bind a key to a command.
|
|||||||
==== note
|
==== note
|
||||||
* This command does not split arguments after the last argument and handles quotes literally.
|
* This command does not split arguments after the last argument and handles quotes literally.
|
||||||
* With this command, +;;+ is interpreted literally instead of splitting off a second command.
|
* With this command, +;;+ is interpreted literally instead of splitting off a second command.
|
||||||
|
* This command does not replace variables like +\{url\}+.
|
||||||
|
|
||||||
[[bookmark-add]]
|
[[bookmark-add]]
|
||||||
=== bookmark-add
|
=== bookmark-add
|
||||||
@ -412,6 +413,7 @@ Execute a command after some time.
|
|||||||
==== note
|
==== note
|
||||||
* This command does not split arguments after the last argument and handles quotes literally.
|
* This command does not split arguments after the last argument and handles quotes literally.
|
||||||
* With this command, +;;+ is interpreted literally instead of splitting off a second command.
|
* With this command, +;;+ is interpreted literally instead of splitting off a second command.
|
||||||
|
* This command does not replace variables like +\{url\}+.
|
||||||
|
|
||||||
[[messages]]
|
[[messages]]
|
||||||
=== messages
|
=== messages
|
||||||
@ -579,6 +581,7 @@ Repeat a given command.
|
|||||||
==== note
|
==== note
|
||||||
* This command does not split arguments after the last argument and handles quotes literally.
|
* This command does not split arguments after the last argument and handles quotes literally.
|
||||||
* With this command, +;;+ is interpreted literally instead of splitting off a second command.
|
* With this command, +;;+ is interpreted literally instead of splitting off a second command.
|
||||||
|
* This command does not replace variables like +\{url\}+.
|
||||||
|
|
||||||
[[report]]
|
[[report]]
|
||||||
=== report
|
=== report
|
||||||
@ -714,6 +717,7 @@ Note the `{url}` and `{url:pretty}` variables might be useful here. `{url}` gets
|
|||||||
|
|
||||||
==== note
|
==== note
|
||||||
* This command does not split arguments after the last argument and handles quotes literally.
|
* This command does not split arguments after the last argument and handles quotes literally.
|
||||||
|
* This command does not replace variables like +\{url\}+.
|
||||||
|
|
||||||
[[stop]]
|
[[stop]]
|
||||||
=== stop
|
=== stop
|
||||||
|
@ -82,7 +82,7 @@ class Command:
|
|||||||
no_cmd_split: If true, ';;' to split sub-commands is ignored.
|
no_cmd_split: If true, ';;' to split sub-commands is ignored.
|
||||||
backend: Which backend the command works with (or None if it works with
|
backend: Which backend the command works with (or None if it works with
|
||||||
both)
|
both)
|
||||||
no_replace_variables: Whether or not to replace variables like {url}
|
no_replace_variables: Don't replace variables like {url}
|
||||||
_qute_args: The saved data from @cmdutils.argument
|
_qute_args: The saved data from @cmdutils.argument
|
||||||
_needs_js: Whether the command needs javascript enabled
|
_needs_js: Whether the command needs javascript enabled
|
||||||
_modes: The modes the command can be executed in.
|
_modes: The modes the command can be executed in.
|
||||||
|
@ -108,9 +108,6 @@ class Command(misc.MinimalLineEditMixin, misc.CommandLineEdit):
|
|||||||
space: If given, a space is added to the end.
|
space: If given, a space is added to the end.
|
||||||
append: If given, the text is appended to the current text.
|
append: If given, the text is appended to the current text.
|
||||||
"""
|
"""
|
||||||
args = split.simple_split(text)
|
|
||||||
text = ' '.join(args)
|
|
||||||
|
|
||||||
if space:
|
if space:
|
||||||
text += ' '
|
text += ' '
|
||||||
if append:
|
if append:
|
||||||
|
@ -239,7 +239,7 @@ def _get_command_doc_notes(cmd):
|
|||||||
Yield:
|
Yield:
|
||||||
Strings which should be added to the docs.
|
Strings which should be added to the docs.
|
||||||
"""
|
"""
|
||||||
if cmd.maxsplit is not None or cmd.no_cmd_split:
|
if cmd.maxsplit is not None or cmd.no_cmd_split or cmd.no_replace_variables:
|
||||||
yield ""
|
yield ""
|
||||||
yield "==== note"
|
yield "==== note"
|
||||||
if cmd.maxsplit is not None:
|
if cmd.maxsplit is not None:
|
||||||
@ -248,6 +248,8 @@ def _get_command_doc_notes(cmd):
|
|||||||
if cmd.no_cmd_split:
|
if cmd.no_cmd_split:
|
||||||
yield ("* With this command, +;;+ is interpreted literally "
|
yield ("* With this command, +;;+ is interpreted literally "
|
||||||
"instead of splitting off a second command.")
|
"instead of splitting off a second command.")
|
||||||
|
if cmd.no_replace_variables:
|
||||||
|
yield "* This command does not replace variables like +\{url\}+."
|
||||||
|
|
||||||
|
|
||||||
def _get_action_metavar(action, nargs=1):
|
def _get_action_metavar(action, nargs=1):
|
||||||
|
Loading…
Reference in New Issue
Block a user