Skip to content

Commit 82d4f73

Browse files
authored
Use tab to cycle through completions (#496)
1 parent e8c5f7a commit 82d4f73

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1616
- PowerShell: handle UTF-8 encoding correctly.
1717
- Zsh: don't hide output from `chpwd` hooks.
1818
- Nushell: upgrade minimum supported version to v0.73.0.
19+
- Zsh: fix extra space in interactive completions when no match is found.
20+
- Fzf: `<TAB>` now cycles through completions.
1921

2022
## [0.8.3] - 2022-09-02
2123

src/util.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ impl Fzf {
3030
#[cfg(not(windows))]
3131
let mut command = Command::new("fzf");
3232
if multiple {
33-
command.arg("-m");
33+
command.arg("--multi");
34+
} else {
35+
command.arg("--bind=tab:down,btab:up");
3436
}
3537
command.arg("--nth=2..").stdin(Stdio::piped()).stdout(Stdio::piped());
3638
if let Some(fzf_opts) = config::fzf_opts() {
@@ -40,6 +42,7 @@ impl Fzf {
4042
// Search result
4143
"--no-sort",
4244
// Interface
45+
"--cycle",
4346
"--keep-right",
4447
// Layout
4548
"--height=50%",

templates/zsh.txt

+1-5
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,7 @@ if [[ -o zle ]]; then
112112
# shellcheck disable=SC2296
113113
compadd -Q "${(q-)result}"
114114
else
115-
{#-
116-
zsh-autocomplete calls the completion function multiple times if no match is
117-
returned.
118-
#}
119-
compadd ""
115+
return 0
120116
fi
121117
\builtin printf '\e[5n'
122118
fi

0 commit comments

Comments
 (0)