1
0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-09-22 03:40:47 +02:00

expand style in compinstall

This commit is contained in:
Peter Stephenson 2001-10-05 16:33:34 +00:00
parent a5890553e8
commit 2dcb35efe0
2 changed files with 55 additions and 0 deletions

View File

@ -1,3 +1,7 @@
2001-10-05 Peter Stephenson <pws@csr.com>
* 15949: Completion/compinstall: add handling for expand style.
2001-10-05 Oliver Kiddle <opk@zsh.org>
* 15851, 15948: Src/builtin.c, Doc/Zsh/builtins.yo: add printf

View File

@ -1529,11 +1529,13 @@ completions?
# squeeze-slashes,
__ci_do_file_styles() {
local key files cursor expand speciald ignorep squeezes select
local prefon suffon
__ci_get_this_style file-sort files
__ci_get_this_style ignore-parents ignorep
__ci_get_this_style special-dirs speciald
__ci_get_this_style squeeze-slashes squeezes
__ci_get_this_style expand expand
while true; do
clear
@ -1548,6 +1550,8 @@ __ci_do_file_styles() {
4. When expanding paths, \`foo//bar' is treated as \`foo/bar'.
5. Configure how multiple paths are expanded, e.g. /f/b -> /foo/bar
q. Return without saving.
0. Done setting options for filename completion.
"
@ -1655,6 +1659,52 @@ one ([y]es, [n]o, [k]eep current setting)?
([nN]) squeezes=;;
esac
;;
(5) if [[ $expand = *prefix* ]]; then
prefon=prefix
else
prefon=
fi
if [[ $expand = *suffix* ]]; then
suffon=suffix
else
suffon=
fi
print "
When expanding /f/b, the shell will attempt to match /f*/b* (e.g. /foo/bar),
and so on to any depth. If the first part of the expansion fails, by default
the shell will not expand the remainder. However, you can force it always
to expand the first part. Currently this feature is ${${prefon:+on}:-off}.
Do you want it on ([y]es, [n]o, [k]eep current setting)?
"
while true; do
read -k key'?--- Hit selection --- '
[[ $key = [yYnNkK] ]] && break
print "Type one of y, n or k."
done
case $key in
([yY]) prefon=prefix;;
([nN]) prefon=prefix;;
esac
print "
Further, if /f*/b* is ambiguous, the shell will usually only expand
as far as the part that is unambiguous; for example, if /foo/bar and
/food/basket exist, it will wait for you to choose either /foo or /food,
and not attempt to expand the rest of the match. However, you can force
it to add all possible completions for you to resolve conflicts in the
normal way. Currently this feature is ${${suffon:+on}:-off}.
Do you want it on ([y]es, [n]o, [k]eep current settign)?
"
while true; do
read -k key'?--- Hit selection --- '
[[ $key = [yYnNkK] ]] && break
print "Type one of y, n or k."
done
case $key in
([yY]) suffon=suffix;;
([nN]) suffon=suffix;;
esac
expand=${prefon:+$prefon${suffon:+ }}${suffon}
;;
(q) return 1
;;
esac
@ -1665,6 +1715,7 @@ one ([y]es, [n]o, [k]eep current setting)?
__ci_set_this_style ignore-parents ignorep
__ci_set_this_style special-dirs speciald
__ci_set_this_style squeeze-slashes squeezes
__ci_set_this_style expand expand
return 0
}