diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2015-10-21 14:29:13 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2015-10-21 14:29:13 +1300 |
commit | a38f6b429a3efea0500db018209ac2f2b27dce1e (patch) | |
tree | ef928e1bc22589d6aeb54a09ce97a16ad54df2f3 /bash | |
parent | Exclude stuff not a filename in current directory (diff) | |
download | dotfiles-a38f6b429a3efea0500db018209ac2f2b27dce1e.tar.gz dotfiles-a38f6b429a3efea0500db018209ac2f2b27dce1e.zip |
Move keyword into glob completion generation
Diffstat (limited to 'bash')
-rw-r--r-- | bash/bashrc.d/sd.bash | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/bash/bashrc.d/sd.bash b/bash/bashrc.d/sd.bash index 75f220d8..4a211f1d 100644 --- a/bash/bashrc.d/sd.bash +++ b/bash/bashrc.d/sd.bash @@ -119,7 +119,6 @@ _sd() { # Build list of matching sibiling directories while IFS= read -d '' -r dirname ; do - [[ $dirname == "${COMP_WORDS[COMP_CWORD]}"* ]] || continue COMPREPLY=("${COMPREPLY[@]}" "$dirname") done < <( @@ -129,7 +128,7 @@ _sd() { # Collect directory names, exclude current directory, strip leading ../ # and trailing / local -a dirnames - dirnames=(../!("${PWD##*/}")/) + dirnames=(../"${COMP_WORDS[COMP_CWORD]}"*/) dirnames=("${dirnames[@]#../}") dirnames=("${dirnames[@]%/}") |