1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-12-08 06:21:40 +01:00

zsh-workers/8864

This commit is contained in:
Tanaka Akira 1999-12-03 08:55:11 +00:00
parent aaf561724c
commit 0eebb6014c
8 changed files with 60 additions and 13 deletions

View file

@ -14,6 +14,8 @@ fi
_lastdescr=( "$_lastdescr[@]" "$3" )
_setup "$1"
_style -s descriptions format format
_style -s "$1" group-name gname && [[ -z "$gname" ]] && gname="$1"

View file

@ -27,19 +27,31 @@ esac
while _tags; do
if _requested all-files; then
(( $#group )) && group[2]=all-files
if (( $#group )); then
group[2]=all-files
_setup all-files
fi
_path_files "$opts[@]" -f
return
elif _requested directories; then
if _requested globbed-files; then
(( $#group )) && group[2]=globbed-files
if (( $#group )); then
group[2]=globbed-files
_setup globbed-files
fi
_path_files "$opts[@]" -/g "$type" && return 0
else
(( $#group )) && group[2]=directories
if (( $#group )); then
group[2]=directories
_setup directories
fi
_path_files "$opts[@]" -/ && return 0
fi
elif _requested globbed-files; then
(( $#group )) && group[2]=globbed-files
if (( $#group )); then
group[2]=globbed-files
_setup globbed-files
fi
_path_files "$opts[@]" -g "$type" && return 0
fi
done

View file

@ -39,6 +39,10 @@ elif [[ "$PREFIX" != */* && "$PREFIX[1]" = '~' ]]; then
compstate[context]=tilde
fi
# Initial setup.
_setup default
# Get the names of the completers to use in the positional parameters.
if (( ! $# )); then

View file

@ -487,12 +487,13 @@ compstyle() {
# Default styles. This should be executed conditionally somehow.
compstyle '*' verbose 'yes'
compstyle '*' prefix-needed 'yes'
compstyle '*' prefix-hidden 'no'
compstyle ':correct' accept '2n'
compstyle ':correct' prompt 'correct to:'
compstyle '*' completer '_complete'
compstyle '*' verbose 'yes'
compstyle '*' prefix-needed 'yes'
compstyle '*' prefix-hidden 'no'
compstyle ':correct' accept '2n'
compstyle ':correct' prompt 'correct to:'
compstyle '*' completer '_complete'
compstyle '*:default' list-colors no=0 fi=0 di=0 ln=0 pi=0 so=0 bd=0 cd=0 ex=0
# Now we automatically make the definition files autoloaded.

View file

@ -964,6 +964,27 @@ item(tt(list-arguments))(
Like the tt(arguments) style, but used when calling the tt(ps) command
to generate the list to display.
)
item(tt(list-colors))(
If the tt(complist) module is used, this style can be used to set
color specifications as with the tt(ZLS_COLORS) and tt(ZLS_COLOURS)
parameters (see
ifzman(the section `The complist Module' in zmanref(zshmodules))\
ifnzman(noderef(The complist Module))\
).
If this style is set for the tt(default) tag, the strings in the value
are taken as specifications that are to be used everywhere. If it is
set for other tags, the specifications are used only for matches of
the type described by the tag.
To be able to share the same specifications one has set up for the GNU
version of the tt(ls) command one can use:
example(compstyle '*:default' list-colors ${(s.:.)LS_COLORS})
And to get the default colors (which are the same as for the GNU
tt(ls) command) one should set the style to an empty value.
)
item(tt(local))(
This style is used by completion functions which generate URLs as
possible matches to add suitable matches when a URL points to a

View file

@ -372,7 +372,7 @@ sect(Builtin Commands)
startitem()
findex(compadd)
cindex(completion widgets, adding specified matches)
xitem(tt(compadd) [ tt(-qQfenUaml12) ] [ tt(-F) var(array) ])
xitem(tt(compadd) [ tt(-qQfenUal12) ] [ tt(-F) var(array) ])
xitem([ tt(-P) var(prefix) ] [ tt(-S) var(suffix) ])
xitem([ tt(-p) var(hidden-prefix) ] [ tt(-s) var(hidden-suffix) ])
xitem([ tt(-i) var(ignored-prefix) ] [ tt(-I) var(ignored-suffix) ])
@ -449,7 +449,7 @@ ignored.
)
item(tt(-l))(
This option only has an effect if used together with the tt(-d)
options. If it is given, the display strings are listed one per line,
option. If it is given, the display strings are listed one per line,
not arrayed in columns.
)
item(tt(-J) var(name))(

View file

@ -118,6 +118,13 @@ The default values are ISO 6429 (ANSI) compliant and can be used on
vt100 compatible terminals such as tt(xterm)s. On monochrome terminals
the default values will have no visual effect.
If the shell function based completion system is used, these
parameters should not be set directly because the system controls them
itself. Instead, the tt(list-colors) style should be used (see
ifzman(the section `Completion System Configuration' in zmanref(zshcompsys))\
ifnzman(noderef(Completion System Configuration))\
).
subsect(Menu selection)
cindex(completion, selecting by cursor)
vindex(SELECTMIN)

View file

@ -2436,7 +2436,7 @@ bin_compstyles(char *nam, char **args, char *ops, int func)
return 1;
}
switch (args[0][1]) {
case 'a': min = 3; max = -1; break;
case 'a': min = 2; max = -1; break;
case 'd': min = 0; max = 2; break;
case 'S': min = 3; max = 3; break;
case 'A': min = 3; max = 3; break;