doc options: more detail on how completions options are handled

Cross-reference the "completers" option, and explain how filtering works.

Originally submitted as part of #4418

Helped-by: Tim Allen <screwtape@froup.com>
This commit is contained in:
Johannes Altmanninger 2022-01-09 20:25:50 +01:00 committed by Maxime Coste
parent 871782faaf
commit c120063da9

View File

@ -150,12 +150,19 @@ are exclusively available to built-in options.
`<select cmd>`, or `<menu text>` fields should be escaped as `\|` `<select cmd>`, or `<menu text>` fields should be escaped as `\|`
or `\\`. or `\\`.
Select commands are arbitrary Kakoune commands that will be executed Options of this type are are meant to be added to the `completers`
each time the element is selected in the menu. The common use case is option to provide insert mode completion. Candidates are shown if the
to display element specific documentation. text typed by the user (between `<line>.<column>` and the cursor) is a
subsequence of `<text>`.
Markup can be used in the menu text. For each remaining candidate, the completion menu displays
(see <<faces#markup-strings,`:doc faces markup-strings`>>) `<text>`, followed by `<menu text>`, which is a Markup string (see
<<faces#markup-strings,`:doc faces markup-strings`>>).
As the user selects items from the completion menu, the text they typed
will be replaced with `<text>`, and the Kakoune command in
`<select cmd>` is executed. The common use case is to display element
specific documentation.
`set -add` adds given completions to the list. + `set -add` adds given completions to the list. +
`set -remove` removes given completions from the list. + `set -remove` removes given completions from the list. +