Skip to content

Commit

Permalink
docs(fuzzy): toggle-exact keybinding #34
Browse files Browse the repository at this point in the history
  • Loading branch information
kazhala committed Feb 2, 2022
1 parent 5a71825 commit 1adb55b
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions docs/pages/prompts/fuzzy.md
Expand Up @@ -63,6 +63,18 @@ The `space` key for toggle choice is also disabled since it blocks user from typ
:end-before: <!-- end list kb -->
```

In addition, with the release of [0.3.2](https://github.com/kazhala/InquirerPy/releases/tag/0.3.2), you can now also toggle string matching algorithm.

```{seealso}
{ref}`pages/prompts/fuzzy:Exact Sub-String match`
```

```{code-block}
{
"toggle-exact": [] # toggle string matching algorithm between fuzzy or exact
}
```

## Multiple Selection

```{seealso}
Expand Down Expand Up @@ -130,6 +142,43 @@ result = inquirer.fuzzy(

</details>

You can also enable a keybinding to toggle the matching algorithm.

<details>
<summary>Classic Syntax (PyInquirer)</summary>

```{code-block} python
from InquirerPy import prompt
questions = [
{
"type": "fuzzy",
"message": "Select actions:",
"choices": ["hello", "weather", "what", "whoa", "hey", "yo"],
"keybindings": {"toggle-exact": [{"key": "c-t"}]},
},
]
result = prompt(questions=questions)
```

</details>

<details open>
<summary>Alternate Syntax</summary>

```{code-block} python
from InquirerPy import inquirer
result = inquirer.fuzzy(
message="Select actions:",
choices=["hello", "weather", "what", "whoa", "hey", "yo"],
keybindings={"toggle-exact": [{"key": "c-t"}]},
).execute()
```

</details>

## Reference

```{eval-rst}
Expand Down

0 comments on commit 1adb55b

Please sign in to comment.