mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-06-21 22:38:05 +02:00
update.
This commit is contained in:
parent
a2159285e8
commit
fe43e0dae0
2 changed files with 26 additions and 4 deletions
|
@ -7,10 +7,32 @@
|
||||||
# `(( compstate[nmatches] )) || compgen -nu -qS/'
|
# `(( compstate[nmatches] )) || compgen -nu -qS/'
|
||||||
# below that.
|
# below that.
|
||||||
|
|
||||||
|
local c s dirs list
|
||||||
|
|
||||||
if [[ "$SUFFIX" = */* ]]; then
|
if [[ "$SUFFIX" = */* ]]; then
|
||||||
ISUFFIX="/${SUFFIX#*/}$ISUFFIX"
|
ISUFFIX="/${SUFFIX#*/}$ISUFFIX"
|
||||||
SUFFIX="${SUFFIX%%/*}"
|
SUFFIX="${SUFFIX%%/*}"
|
||||||
compgen -nu -S ''
|
s=(-S '')
|
||||||
else
|
else
|
||||||
compgen -nu -qS/
|
s=(-qS/)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if compset -P +; then
|
||||||
|
dirs="$(dirs -v)"
|
||||||
|
list=("${(f)dirs}")
|
||||||
|
[[ -o pushdminus ]] && dirs="$(awk '{ $1 = '$#list' - $1 - 1;
|
||||||
|
printf("%s\t%s\n", $1, $2); }' <<<$dirs)"
|
||||||
|
list=("${(@)list% *}")
|
||||||
|
c=(-y '$dirs' -k "($list)")
|
||||||
|
elif compset -P -; then
|
||||||
|
dirs="$(dirs -v)"
|
||||||
|
list=("${(f)dirs}")
|
||||||
|
[[ ! -o pushdminus ]] && dirs="$(awk '{ $1 = '$#list' - $1 - 1;
|
||||||
|
printf("%s\t%s\n", $1, $2); }' <<<$dirs)"
|
||||||
|
list=("${(@)list% *}")
|
||||||
|
c=(-y '$dirs' -k "($list)")
|
||||||
|
else
|
||||||
|
c=(-nu)
|
||||||
|
fi
|
||||||
|
|
||||||
|
compgen "$c[@]" "$s[@]"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#compdef make gmake pmake
|
#compdef make gmake pmake
|
||||||
|
|
||||||
compgen -s "\$(awk '/^[a-zA-Z0-9][^\/ ]+:/ {print \$1}' FS=: [mM]akefile /dev/null)" ||
|
compgen -s "\$(awk '/^[_a-zA-Z0-9][-._a-zA-Z0-9]*[^\/ ]+:/ {print \$1}' FS=: [mM]akefile /dev/null)" ||
|
||||||
_files
|
compgen -f
|
||||||
|
|
Loading…
Reference in a new issue