Skip to content

Commit

Permalink
doc options: state that all |-separated tuples need escaping
Browse files Browse the repository at this point in the history
For the "completions" option type, the documentation states that |
and \ need to be escaped as \| and \\.
The same parser is for other option types that are lists-of-tuples:
range-specs and line-specs, so they need escaping too. Document that.

Only their last element can contain arbitrary data, so range-specs
and line-specs could work without escaping if we tweaked the parser.
  • Loading branch information
krobelus committed Oct 29, 2021
1 parent d2e2caa commit 068623e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion doc/pages/options.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ are exclusively available to built-in options.
is empty, but still valid.

* _string_ is an arbitrary string which is associated with
the range.
the range. Any `|` or `\` characters must be escaped as `\|` or `\\`.

All numeric fields are 1-based.

Expand All @@ -138,6 +138,9 @@ are exclusively available to built-in options.
`set -add` appends the new specs to the list. +
`set -remove` removes the given specs from the list. +

Any `|` or `\` characters that occur within `<flag text>` must be
escaped as `\|` or `\\`.

*completions*::
a list of `<text>|<select cmd>|<menu text>` candidates,
except for the first element which follows the
Expand Down

0 comments on commit 068623e

Please sign in to comment.