aboutsummaryrefslogtreecommitdiff
path: root/bash
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2015-10-21 14:29:13 +1300
committerTom Ryder <tom@sanctum.geek.nz>2015-10-21 14:29:13 +1300
commita38f6b429a3efea0500db018209ac2f2b27dce1e (patch)
treeef928e1bc22589d6aeb54a09ce97a16ad54df2f3 /bash
parentExclude stuff not a filename in current directory (diff)
downloaddotfiles-a38f6b429a3efea0500db018209ac2f2b27dce1e.tar.gz
dotfiles-a38f6b429a3efea0500db018209ac2f2b27dce1e.zip
Move keyword into glob completion generation
Diffstat (limited to 'bash')
-rw-r--r--bash/bashrc.d/sd.bash3
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[@]%/}")