diff options
| author | Peter Stephenson <pws@users.sourceforge.net> | 2000-04-01 20:43:43 +0000 |
|---|---|---|
| committer | Peter Stephenson <pws@users.sourceforge.net> | 2000-04-01 20:43:43 +0000 |
| commit | e025336f2f6d9f107ee1e03b9900f04af0544ba9 (patch) | |
| tree | 37b0ce74587d42d4bcb024991526d2361fcdf04a /Completion/Core/_setup | |
| parent | Initial revision (diff) | |
| download | zsh-e025336f2f6d9f107ee1e03b9900f04af0544ba9.tar zsh-e025336f2f6d9f107ee1e03b9900f04af0544ba9.tar.gz zsh-e025336f2f6d9f107ee1e03b9900f04af0544ba9.tar.bz2 zsh-e025336f2f6d9f107ee1e03b9900f04af0544ba9.tar.lz zsh-e025336f2f6d9f107ee1e03b9900f04af0544ba9.tar.xz zsh-e025336f2f6d9f107ee1e03b9900f04af0544ba9.tar.zst zsh-e025336f2f6d9f107ee1e03b9900f04af0544ba9.zip | |
Updated from list as far as 10376
Diffstat (limited to 'Completion/Core/_setup')
| -rw-r--r-- | Completion/Core/_setup | 66 |
1 files changed, 57 insertions, 9 deletions
diff --git a/Completion/Core/_setup b/Completion/Core/_setup index f12c34b34..ed7307e69 100644 --- a/Completion/Core/_setup +++ b/Completion/Core/_setup @@ -1,13 +1,61 @@ #autoload -local colors i +local val nm="$compstate[nmatches]" -for i; do - if _style -a "$i" list-colors colors; then - if [[ "$1" = default ]]; then - ZLS_COLORS="${(j.:.)${(@)colors:gs/:/\\\:}}" - else - eval "ZLS_COLORS=\"(${i})\${(j.:(${i}).)\${(@)colors:gs/:/\\\:}}:\${ZLS_COLORS}\"" - fi +if zstyle -a ":completion:${curcontext}:$1" list-colors val; then + zmodload -i zsh/complist + if [[ "$1" = default ]]; then + ZLS_COLORS="${(j.:.)${(@)val:gs/:/\\\:}}" + else + eval "ZLS_COLORS=\"(${1})\${(j.:(${1}).)\${(@)val:gs/:/\\\:}}:\${ZLS_COLORS}\"" fi -done + +# Here is the problem mentioned in _main_complete. + +# elif [[ "$1" = default && -n "$ZLS_COLORS$ZLS_COLOURS" ]]; then +# zmodload -i zsh/complist +# ZLS_COLORS="$ZLS_COLORS$ZLS_COLOURS" + +fi + +if zstyle -t ":completion:${curcontext}:$1" list-packed; then + compstate[list]="${compstate[list]} packed" +elif [[ $? -eq 1 ]]; then + compstate[list]="${compstate[list]:gs/packed//}" +else + compstate[list]="$_saved_list" +fi + +if zstyle -t ":completion:${curcontext}:$1" list-rows-first; then + compstate[list]="${compstate[list]} rows" +elif [[ $? -eq 1 ]]; then + compstate[list]="${compstate[list]:gs/rows//}" +else + compstate[list]="$_saved_list" +fi + +if zstyle -t ":completion:${curcontext}:$1" last-prompt; then + compstate[last_prompt]=yes +elif [[ $? -eq 1 ]]; then + compstate[last_prompt]='' +else + compstate[last_prompt]="$_saved_lastprompt" +fi + +if zstyle -t ":completion:${curcontext}:$1" accept-exact; then + compstate[exact]=accept +elif [[ $? -eq 1 ]]; then + compstate[exact]='' +else + compstate[exact]="$_saved_exact" +fi + +[[ _last_nmatches -ge 0 && _last_nmatches -ne nm ]] && + _menu_style=( "$_last_menu_style[@]" "$_menu_style[@]" ) + +if zstyle -a ":completion:${curcontext}:$1" menu val; then + _last_nmatches=$nm + _last_menu_style=( "$val[@]" ) +else + _last_nmatches=-1 +fi |
