1
0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-10-02 00:41:44 +02:00

comment out looking up the prefix-needed style when completing directory stack entries; make _tilde use _popd, finally (13789)

This commit is contained in:
Sven Wischnowsky 2001-03-27 12:22:53 +00:00
parent 6d72dca54f
commit aa9c315cc8
3 changed files with 20 additions and 31 deletions

@ -1,5 +1,10 @@
2001-03-27 Sven Wischnowsky <wischnow@zsh.org>
* 13789: Completion/Base/_tilde, Completion/Builtins/_popd:
comment out looking up the prefix-needed style when
completing directory stack entries; make _tilde use _popd,
finally
* 3752: Completion/Commands/_history_complete_word,
Src/Zle/compresult.c: try to make _h_c_w smarter at the
beginning and end of the list; avoid list-beeping if the old

@ -24,33 +24,7 @@ while _tags; do
_requested named-directories expl 'named directory' \
compadd "$suf[@]" "$@" -k nameddirs
if _requested directory-stack &&
{ ! zstyle -T ":completion:${curcontext}:directory-stack" prefix-needed ||
[[ "$PREFIX" = [-+]* || nm -eq compstate[nmatches] ]] }; then
if zstyle -T ":completion:${curcontext}:directory-stack" verbose; then
integer i
_requested directory-stack && _popd "$suf[@]" && ret=0
lines=("${PWD}" "${dirstack[@]}")
if [[ ( -prefix - && ! -o pushdminus ) ||
( -prefix + && -o pushdminus ) ]]; then
revlines=( $lines )
for (( i = 1; i <= $#lines; i++ )); do
lines[$i]="$((i-1)) -- ${revlines[-$i]}"
done
else
for (( i = 1; i <= $#lines; i++ )); do
lines[$i]="$((i-1)) -- ${lines[$i]}"
done
fi
list=( ${PREFIX[1]}${^lines%% *} )
disp=( -ld lines )
else
list=( ${PREFIX[1]}{0..${#dirstack}} )
disp=()
fi
_all_labels -V directory-stack expl 'directory stack' \
compadd "$suf[@]" "$disp[@]" -Q -a list && ret=0
fi
(( ret )) || return 0
done

@ -7,10 +7,20 @@
setopt localoptions nonomatch
local expl list lines revlines disp
local expl list lines revlines disp suf
! zstyle -T ":completion:${curcontext}:directory-stack" prefix-needed ||
[[ $PREFIX = [-+]* ]] || return 1
if [[ "$SUFFIX" = */* ]]; then
ISUFFIX="/${SUFFIX#*/}$ISUFFIX"
SUFFIX="${SUFFIX%%/*}"
suf=(-S '')
else
suf=(-qS/)
fi
### we decided against this, for now...
#! zstyle -T ":completion:${curcontext}:directory-stack" prefix-needed ||
[[ $PREFIX = [-+]* ]] || return 1
if zstyle -T ":completion:${curcontext}:directory-stack" verbose; then
# get the list of directories with their canonical number
@ -38,4 +48,4 @@ else
fi
_wanted -V directory-stack expl 'directory stack' \
compadd "$@" "$disp[@]" -Q -a list
compadd "$@" "$suf[@]" "$disp[@]" -Q -a list