aboutsummaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorJohn Ericson <git@JohnEricson.me>2022-10-28 23:22:18 +0100
committerGitHub <noreply@github.com>2022-10-28 23:22:18 +0100
commit13f2a6f38db44385ae1c7d3d01170149de328abb (patch)
tree9184949feb826f00b7a5bc4175dda4667055e44c /misc
parent12461e246b02371c6b6981b4e65985e9397474e1 (diff)
parentb7e8a3bf4cbb2448db860f65ea13ef2c64b6883b (diff)
Merge branch 'master' into indexed-store-path-outputs
Diffstat (limited to 'misc')
-rw-r--r--misc/zsh/completion.zsh11
1 files changed, 6 insertions, 5 deletions
diff --git a/misc/zsh/completion.zsh b/misc/zsh/completion.zsh
index e702c721e..f9b3dca74 100644
--- a/misc/zsh/completion.zsh
+++ b/misc/zsh/completion.zsh
@@ -10,14 +10,15 @@ function _nix() {
local -a suggestions
declare -a suggestions
for suggestion in ${res:1}; do
- # FIXME: This doesn't work properly if the suggestion word contains a `:`
- # itself
- suggestions+="${suggestion/ /:}"
+ suggestions+=("${suggestion%% *}")
done
+ local -a args
if [[ "$tpe" == filenames ]]; then
- compadd -f
+ args+=('-f')
+ elif [[ "$tpe" == attrs ]]; then
+ args+=('-S' '')
fi
- _describe 'nix' suggestions
+ compadd -J nix "${args[@]}" -a suggestions
}
_nix "$@"