1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-06-20 21:50:42 +02:00

yet another followup to 15497; make _describe filter out non-matching strings before calling compdescribe, otherwise some matches will be hiddens (15415)

This commit is contained in:
Sven Wischnowsky 2001-07-19 08:40:36 +00:00
parent 6a3e89d539
commit facff10b11
3 changed files with 53 additions and 3 deletions

View File

@ -1,3 +1,10 @@
2001-07-19 Sven Wischnowsky <wischnow@zsh.org>
* 15415: Completion/Base/Utility/_describe, Src/Zle/computil.c:
yet another followup to 15407; make _describe filter out
non-matching strings before calling compdescribe, otherwise
some matches will be hiddens
2001-07-18 Sven Wischnowsky <wischnow@zsh.org>
* 15409: Src/Zle/computil.c: fix for 15407; there may be sets

View File

@ -21,8 +21,49 @@ fi
# Do the tests. `showd' is set if the descriptions should be shown.
zstyle -T ":completion:${curcontext}:$_type" verbose && _showd=yes
if zstyle -T ":completion:${curcontext}:$_type" list-grouped; then
local _argv _new _strs _mats _opts _i=2
_argv=( "$@" )
_grp=(-g)
_new=( "$1" )
shift
while (( $# )); do
_strs="_a_$_i"
eval local "_a_$_i;_a_$_i"'=( "${'$1'[@]}" )'
_argv[_i]="_a_$_i"
shift
(( _i++ ))
if [[ "$1" = (|-*) ]]; then
_mats=
else
_matss="_a_$_i"
eval local "_a_$_i;_a_$_i"'=( "${'$1'[@]}" )'
_argv[_i]="_a_$_i"
shift
(( _i++ ))
fi
_opts=( "${(@)argv[1,(i)--]:#--}" )
shift "$#_opts"
(( _i += $#_opts ))
if [[ $1 == -- ]]; then
shift
(( _i++ ))
fi
if [[ -n $_mats ]]; then
compadd "$_opts[@]" -O $_strs -D $_mats -a $_strs
else
compadd "$_opts[@]" -O $_strs -a $_strs
fi
done
set - "$_argv[@]"
else
_grp=()
fi
@ -50,9 +91,11 @@ while _tags; do
if [[ -n "$_hide" ]]; then
if [[ "$PREFIX" = --* ]]; then
_tmpd=( "${(@)_tmpd#--}" )
_tmph=( "${(@)_tmph#--}" )
_tmps=( "${(@)_tmps#--}" )
elif [[ "$PREFIX" = [-+]* ]]; then
_tmpd=( "${(@)_tmpd#[-+]}" )
_tmph=( "${(@)_tmph#[-+]}" )
_tmps=( "${(@)_tmps#[-+]}" )
fi
fi

View File

@ -64,7 +64,7 @@ struct cdset {
/* Maximum string length when used with descriptions. */
#define CD_MAXLEN 20
#define CD_MAXLEN 30
static struct cdstate cd_state;
@ -171,8 +171,8 @@ cd_calc()
}
}
}
if (cd_state.pre > 20)
cd_state.pre = 20;
if (cd_state.pre > CD_MAXLEN)
cd_state.pre = CD_MAXLEN;
}
/* Initialisation. Store and calculate the string and matches and so on. */