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:
Jan Verbeek 2016-08-04 13:21:19 +02:00
parent c7c5a98506
commit 827de1743d
4 changed files with 8 additions and 5 deletions

View File

@ -111,6 +111,7 @@ Bind a key to a command.
==== note
* 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.
* This command does not replace variables like +\{url\}+.
[[bookmark-add]]
=== bookmark-add
@ -412,6 +413,7 @@ Execute a command after some time.
==== note
* 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.
* This command does not replace variables like +\{url\}+.
[[messages]]
=== messages
@ -579,6 +581,7 @@ Repeat a given command.
==== note
* 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.
* This command does not replace variables like +\{url\}+.
[[report]]
=== report
@ -714,6 +717,7 @@ Note the `{url}` and `{url:pretty}` variables might be useful here. `{url}` gets
==== note
* This command does not split arguments after the last argument and handles quotes literally.
* This command does not replace variables like +\{url\}+.
[[stop]]
=== stop

View File

@ -82,7 +82,7 @@ class Command:
no_cmd_split: If true, ';;' to split sub-commands is ignored.
backend: Which backend the command works with (or None if it works with
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
_needs_js: Whether the command needs javascript enabled
_modes: The modes the command can be executed in.

View File

@ -108,9 +108,6 @@ class Command(misc.MinimalLineEditMixin, misc.CommandLineEdit):
space: If given, a space is added to the end.
append: If given, the text is appended to the current text.
"""
args = split.simple_split(text)
text = ' '.join(args)
if space:
text += ' '
if append:

View File

@ -239,7 +239,7 @@ def _get_command_doc_notes(cmd):
Yield:
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 "==== note"
if cmd.maxsplit is not None:
@ -248,6 +248,8 @@ def _get_command_doc_notes(cmd):
if cmd.no_cmd_split:
yield ("* With this command, +;;+ is interpreted literally "
"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):