1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-01-30 15:02:18 +01:00

make _files not use its own description if there is one from a calling function; improve -P-prefix handling in _path_files (15389)

This commit is contained in:
Sven Wischnowsky 2001-07-13 08:09:49 +00:00
parent 73d0e1adb1
commit 45051d58ab
3 changed files with 18 additions and 3 deletions

View file

@ -1,3 +1,10 @@
2001-07-13 Sven Wischnowsky <wischnow@zsh.org>
* 15389: Completion/Unix/Type/_files,
Completion/Unix/Type/_path_files: make _files not use its own
description if there is one from a calling function; improve
-P-prefix handling in _path_files
2001-07-11 Bart Schaefer <schaefer@zsh.org>
* 15375: Doc/Zsh/options.yo: Explain the effect of CORRECT on

View file

@ -65,7 +65,11 @@ for def in "$pats[@]"; do
if [[ "$sdef" = *:${tag}:* ]]; then
descr="${(Q)sdef#*:${tag}:}"
else
descr=file
if (( $opts[(I)-X] )); then
descr=
else
descr=file
fi
end=yes
fi

View file

@ -5,7 +5,7 @@
local linepath realpath donepath prepath testpath exppath skips skipped
local tmp1 tmp2 tmp3 tmp4 i orig eorig pre suf tpre tsuf opre osuf cpre
local pats haspats ignore pfxsfx sopt gopt opt sdirs ignpar cfopt listsfx
local pats haspats ignore pfx pfxsfx sopt gopt opt sdirs ignpar cfopt listsfx
local nm=$compstate[nmatches] menu matcher mopts sort match mid accex fake
typeset -U prepaths exppaths
@ -15,7 +15,7 @@ exppaths=()
# Get the options.
zparseopts -a mopts \
'P:=pfxsfx' 'S:=pfxsfx' 'q=pfxsfx' 'r:=pfxsfx' 'R:=pfxsfx' \
'P:=pfx' 'S:=pfxsfx' 'q=pfxsfx' 'r:=pfxsfx' 'R:=pfxsfx' \
'W:=prepaths' 'F:=ignore' 'M+:=matcher' \
J+: V+: X+: 1: 2: n: 'f=tmp1' '/=tmp1' 'g+:-=tmp1'
@ -29,6 +29,10 @@ else
fi
pats=( "${(@)pats:# #}" )
if (( $#pfx )); then
compset -P "$pfx[2]" || pfxsfx=( "$pfx[@]" "$pfxsfx[@]" )
fi
if (( $#prepaths )); then
tmp1="${prepaths[2]}"
if [[ "$tmp1[1]" = '(' ]]; then