mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-01-30 15:02:18 +01:00
some more places where list-separator should be used (15485)
This commit is contained in:
parent
c83d16f8ee
commit
1df4b6620b
5 changed files with 27 additions and 16 deletions
|
@ -1,5 +1,10 @@
|
|||
2001-07-25 Sven Wischnowsky <wischnow@zsh.org>
|
||||
|
||||
* 15485: Completion/Unix/Command/_lzop,
|
||||
Completion/Zsh/Type/_directory_stack,
|
||||
Completion/Zsh/Type/_file_descriptors, Completion/Zsh/Type/_jobs:
|
||||
some more places where list-separator should be used
|
||||
|
||||
* 15484: Completion/AIX/Command/_lscfg,
|
||||
Completion/AIX/Type/_logical_volumes,
|
||||
Completion/Base/Utility/_describe,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#compdef lzop
|
||||
|
||||
local expl state line decompress disp curcontext="$curcontext"
|
||||
local expl state line decompress disp curcontext="$curcontext" sep
|
||||
typeset -A opt_args
|
||||
|
||||
_arguments -C -s \
|
||||
|
@ -91,12 +91,13 @@ case "$state" in
|
|||
fi
|
||||
;;
|
||||
flags)
|
||||
zstyle -s ":completion:${curcontext}:flags" list-separator sep || sep=--
|
||||
disp=( \
|
||||
"F -- Append a \`*' for executable files" \
|
||||
"G -- Inhibit display of group information" \
|
||||
"Q -- Enclose file names in double quotes" )
|
||||
disp=( ${disp[@]%[Z$PREFIX] -*} )
|
||||
"F $sep Append a \`*' for executable files" \
|
||||
"G $sep Inhibit display of group information" \
|
||||
"Q $sep Enclose file names in double quotes" )
|
||||
disp=( ${disp[@]:#[Z$PREFIX]*} )
|
||||
compset -P '[FGQ]*'
|
||||
compadd -d disp - ${disp[@]% -*}
|
||||
compadd -d disp - ${disp[@]%% *}
|
||||
;;
|
||||
esac
|
||||
|
|
|
@ -7,11 +7,13 @@
|
|||
|
||||
setopt localoptions nonomatch
|
||||
|
||||
local expl list lines revlines disp
|
||||
local expl list lines revlines disp sep
|
||||
|
||||
### we decided against this, for now...
|
||||
#! zstyle -T ":completion:${curcontext}:directory-stack" prefix-needed ||
|
||||
|
||||
zstyle -s ":completion:${curcontext}:directory-stack" list-separator sep || sep=--
|
||||
|
||||
[[ $PREFIX = [-+]* ]] || return 1
|
||||
|
||||
if zstyle -T ":completion:${curcontext}:directory-stack" verbose; then
|
||||
|
@ -24,11 +26,11 @@ if zstyle -T ":completion:${curcontext}:directory-stack" verbose; then
|
|||
integer i
|
||||
revlines=( $lines )
|
||||
for (( i = 1; i <= $#lines; i++ )); do
|
||||
lines[$i]="$((i-1)) -- ${revlines[-$i]##[0-9]#[ ]#}"
|
||||
lines[$i]="$((i-1)) $sep ${revlines[-$i]##[0-9]#[ ]#}"
|
||||
done
|
||||
else
|
||||
for (( i = 1; i <= $#lines; i++ )); do
|
||||
lines[$i]="$i -- ${lines[$i]##[0-9]#[ ]#}"
|
||||
lines[$i]="$i $sep ${lines[$i]##[0-9]#[ ]#}"
|
||||
done
|
||||
fi
|
||||
# get the array of numbers only
|
||||
|
|
|
@ -1,20 +1,22 @@
|
|||
#autoload
|
||||
|
||||
local i fds expl list link
|
||||
local i fds expl list link sep
|
||||
|
||||
for i in {0..9}; [[ -e /dev/fd/$i ]] && fds=( ${fds[@]} $i )
|
||||
|
||||
if zstyle -T ":completion:${curcontext}" verbose && [[ -e /proc/$$/fd ]]; then
|
||||
if zstyle -T ":completion:${curcontext}:" verbose && [[ -e /proc/$$/fd ]]; then
|
||||
zstyle -s ":completion:${curcontext}:" list-separator sep || sep=--
|
||||
|
||||
if zmodload -e zsh/stat; then
|
||||
for i in "${fds[@]}"; do
|
||||
stat +link -A link /proc/$$/fd/$i
|
||||
list=( ${list[@]} "$i -- ${link[1]}" )
|
||||
list=( ${list[@]} "$i $sep ${link[1]}" )
|
||||
done
|
||||
elif (( $+commands[readlink] )); then
|
||||
for i in "${fds[@]}"; list=( ${list[@]} "$i -- $(readlink /proc/$$/fd/$i)" )
|
||||
for i in "${fds[@]}"; list=( ${list[@]} "$i $sep $(readlink /proc/$$/fd/$i)" )
|
||||
else
|
||||
for i in "${fds[@]}"; do
|
||||
list=( ${list[@]} "$i -- $(ls -l /proc/$$/fd/$i|sed 's/.*-> //' )" )
|
||||
list=( ${list[@]} "$i $sep $(ls -l /proc/$$/fd/$i|sed 's/.*-> //' )" )
|
||||
done
|
||||
fi
|
||||
_wanted file-descriptors expl 'file descriptors' compadd "$@" -d list -a fds
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#autoload
|
||||
|
||||
local expl disp jobs job jids pfx='%' desc how expls
|
||||
local expl disp jobs job jids pfx='%' desc how expls sep
|
||||
|
||||
if [[ "$1" = -t ]]; then
|
||||
zstyle -T ":completion:${curcontext}:jobs" prefix-needed &&
|
||||
|
@ -26,9 +26,10 @@ fi
|
|||
|
||||
if [[ -n "$desc" ]]; then
|
||||
disp=()
|
||||
zstyle -s ":completion:${curcontext}:jobs" list-separator sep || sep=--
|
||||
for job in "$jids[@]"; do
|
||||
[[ -n "$desc" ]] &&
|
||||
disp=( "$disp[@]" "${pfx}${(r:2:: :)job} -- ${(r:COLUMNS-8:: :)jobtexts[$job]}" )
|
||||
disp=( "$disp[@]" "${pfx}${(r:2:: :)job} $sep ${(r:COLUMNS-8:: :)jobtexts[$job]}" )
|
||||
done
|
||||
fi
|
||||
|
||||
|
|
Loading…
Reference in a new issue