aboutsummaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2021-12-22 17:55:05 +0100
committerGitHub <noreply@github.com>2021-12-22 17:55:05 +0100
commitb666a2ca8c99a35ebab07ef86f4f6e01c278a30f (patch)
tree667e5793204ad6e179211d06eac8a7545575e90a /misc
parentddd78391547be5f34f4042fd48124c0ced1f33b2 (diff)
parentc4a03bc4ae7ac89dfca3ada27d1a7946d568d4d3 (diff)
Merge pull request #5820 from ncfavier/completion-nospace
Don't insert spaces when completing attribute paths
Diffstat (limited to 'misc')
-rw-r--r--misc/bash/completion.sh4
-rw-r--r--misc/fish/completion.fish1
2 files changed, 3 insertions, 2 deletions
diff --git a/misc/bash/completion.sh b/misc/bash/completion.sh
index 0af90d8c1..8fc224792 100644
--- a/misc/bash/completion.sh
+++ b/misc/bash/completion.sh
@@ -7,8 +7,10 @@ function _complete_nix {
local completion=${line%% *}
if [[ -z $have_type ]]; then
have_type=1
- if [[ $completion = filenames ]]; then
+ if [[ $completion == filenames ]]; then
compopt -o filenames
+ elif [[ $completion == attrs ]]; then
+ compopt -o nospace
fi
else
COMPREPLY+=("$completion")
diff --git a/misc/fish/completion.fish b/misc/fish/completion.fish
index bedbefaf8..c6b8ef16a 100644
--- a/misc/fish/completion.fish
+++ b/misc/fish/completion.fish
@@ -19,7 +19,6 @@ end
function _nix_accepts_files
set -l response (_nix_complete)
- # First line is either filenames or no-filenames.
test $response[1] = 'filenames'
end