Skip to content

Commit b81b52d

Browse files
authored
Don't mention positional on custom completer page (#1897)
* Don't mention positional on custom completer page * Whoops, missed one
1 parent cf96235 commit b81b52d

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

book/custom_completions.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ In the second line, `string@animals` tells Nushell two things—the shape of the
2929
The third line is demonstration of the completion. Type the name of the custom command `my-command`, followed by a space, and then the <kbd>Tab</kbd> key. This displays a menu with the possible completions. Custom completions work the same as other completions in the system, allowing you to type `e` followed by the <kbd>Tab</kbd> key to complete "eel" automatically.
3030

3131
::: tip
32-
When the completion menu is displayed, the prompt changes to include the `|` character by default. To change the prompt marker, modify the `marker` value of the record, where the `name` key is `completion_menu`, in the `$env.config.menus` list. See also [the completion menu configuration](/book/line_editor.md#completion-menu).
32+
When the completion menu is displayed, the prompt changes to include the `|` character by default. To change the prompt marker, modify the `marker` value of the record, where the `name` key is `completion_menu`, in the `$env.config.menus` list. See also [the completion menu configuration](/book/line_editor.md#completion-menu).
3333
:::
3434

3535
::: tip
@@ -42,8 +42,7 @@ If you want to choose how your completions are filtered and sorted, you can also
4242

4343
- `sort` - Set this to `false` to stop Nushell from sorting your completions. By default, this is `true`, and completions are sorted according to `$env.config.completions.sort`.
4444
- `case_sensitive` - Set to `true` for the custom completions to be matched case sensitively, `false` otherwise. Used for overriding `$env.config.completions.case_sensitive`.
45-
- `completion_algorithm` - Set this to either `prefix` or `fuzzy` to choose how your completions are matched against the typed text. Used for overriding `$env.config.completions.algorithm`.
46-
- `positional` - When prefix matching is used, setting this to `false` will use substring matching instead. `true` by default.
45+
- `completion_algorithm` - Set this to `prefix`, `substring`, or `fuzzy` to choose how your completions are matched against the typed text. Used for overriding `$env.config.completions.algorithm`.
4746

4847
Here's an example demonstrating how to set these options:
4948

@@ -52,8 +51,7 @@ def animals [] {
5251
{
5352
options: {
5453
case_sensitive: false,
55-
completion_algorithm: prefix,
56-
positional: false,
54+
completion_algorithm: substring,
5755
sort: false,
5856
},
5957
completions: [cat, rat, bat]
@@ -69,7 +67,7 @@ Now, if you try to complete `A`, you get the following completions:
6967
cat rat bat
7068
```
7169

72-
Because we made matching case-insensitive and used `positional: false`, Nushell will find the substring "a" in all of the completion suggestions. Additionally, because we set `sort: false`, the completions will be left in their original order. This is useful if your completions are already sorted in a particular order unrelated to their text (e.g. by date).
70+
Because we made matching case-insensitive, Nushell will find the substring "a" in all of the completion suggestions. Additionally, because we set `sort: false`, the completions will be left in their original order. This is useful if your completions are already sorted in a particular order unrelated to their text (e.g. by date).
7371

7472
## Modules and Custom Completions
7573

0 commit comments

Comments
 (0)