Use tab to cycle through completions

This commit is contained in:
Ajeet D'Souza 2022-12-09 01:19:45 +05:30
parent e8c5f7a975
commit e3a9b861fd
3 changed files with 7 additions and 6 deletions

View File

@ -16,6 +16,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- PowerShell: handle UTF-8 encoding correctly. - PowerShell: handle UTF-8 encoding correctly.
- Zsh: don't hide output from `chpwd` hooks. - Zsh: don't hide output from `chpwd` hooks.
- Nushell: upgrade minimum supported version to v0.73.0. - Nushell: upgrade minimum supported version to v0.73.0.
- Zsh: fix extra space in interactive completions when no match is found.
- Fzf: `<TAB>` now cycles through completions.
## [0.8.3] - 2022-09-02 ## [0.8.3] - 2022-09-02

View File

@ -30,7 +30,9 @@ impl Fzf {
#[cfg(not(windows))] #[cfg(not(windows))]
let mut command = Command::new("fzf"); let mut command = Command::new("fzf");
if multiple { if multiple {
command.arg("-m"); command.arg("--multi");
} else {
command.arg("--bind=tab:down,btab:up");
} }
command.arg("--nth=2..").stdin(Stdio::piped()).stdout(Stdio::piped()); command.arg("--nth=2..").stdin(Stdio::piped()).stdout(Stdio::piped());
if let Some(fzf_opts) = config::fzf_opts() { if let Some(fzf_opts) = config::fzf_opts() {
@ -40,6 +42,7 @@ impl Fzf {
// Search result // Search result
"--no-sort", "--no-sort",
// Interface // Interface
"--cycle",
"--keep-right", "--keep-right",
// Layout // Layout
"--height=50%", "--height=50%",

View File

@ -112,11 +112,7 @@ if [[ -o zle ]]; then
# shellcheck disable=SC2296 # shellcheck disable=SC2296
compadd -Q "${(q-)result}" compadd -Q "${(q-)result}"
else else
{#- return 0
zsh-autocomplete calls the completion function multiple times if no match is
returned.
#}
compadd ""
fi fi
\builtin printf '\e[5n' \builtin printf '\e[5n'
fi fi