mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-01-21 12:11:26 +01:00
Peter: 24235: handle underscores
This commit is contained in:
parent
b7669a8399
commit
c48b70d59e
2 changed files with 10 additions and 5 deletions
|
@ -1,3 +1,8 @@
|
|||
2007-12-13 Clint Adams <clint@zsh.org>
|
||||
|
||||
* Peter: 24235: Completion/Base/Utility/_arguments: handle
|
||||
underscores.
|
||||
|
||||
2007-12-13 Peter Stephenson <p.w.stephenson@ntlworld.com>
|
||||
|
||||
* 24241: Doc/Zsh/expn.yo: explain the effect of time glob
|
||||
|
|
|
@ -97,7 +97,7 @@ if (( long )); then
|
|||
# present. Maybe the problem was that the intervening code
|
||||
# didn't. If it's buggy without removing them, the problem
|
||||
# probably is later, not here.
|
||||
if [[ -z ${tmp[(r)${match[1]%%[^a-zA-Z0-9-]#}]} ]]; then
|
||||
if [[ -z ${tmp[(r)${match[1]%%[^a-zA-Z0-9_-]#}]} ]]; then
|
||||
tmp+=($match[1])
|
||||
fi
|
||||
opt=$match[2]
|
||||
|
@ -218,9 +218,9 @@ if (( long )); then
|
|||
odescr=
|
||||
fi
|
||||
if [[ $opt = (#b)(*)\[\=* ]]; then
|
||||
opt2=${${match[1]}//[^a-zA-Z0-9-]}=-${dir}${odescr}
|
||||
opt2=${${match[1]}//[^a-zA-Z0-9_-]}=-${dir}${odescr}
|
||||
else
|
||||
opt2=${${opt}//[^a-zA-Z0-9-]}=${dir}${odescr}
|
||||
opt2=${${opt}//[^a-zA-Z0-9_-]}=${dir}${odescr}
|
||||
fi
|
||||
if [[ "$descr" = :\=* ]]; then
|
||||
cache+=( "${opt2}::${(L)${opt%\]}#*\=}: " )
|
||||
|
@ -247,7 +247,7 @@ if (( long )); then
|
|||
else
|
||||
odescr=
|
||||
fi
|
||||
opt2="${${opt%%\=*}//[^a-zA-Z0-9-]}=${dir}${odescr}"
|
||||
opt2="${${opt%%\=*}//[^a-zA-Z0-9_-]}=${dir}${odescr}"
|
||||
if [[ "$descr" = :\=* ]]; then
|
||||
cache+=( "${opt2}:${(L)${opt%\]}#*\=}: " )
|
||||
else
|
||||
|
@ -268,7 +268,7 @@ if (( long )); then
|
|||
# I discovered after about half an hour, so don't do that.
|
||||
"${(@)^${(@)tmp:#^*:*}//:/[}]"
|
||||
# commands with no description
|
||||
"${(@)${(@)tmp:#*:*}//[^a-zA-Z0-9-]}")
|
||||
"${(@)${(@)tmp:#*:*}//[^a-zA-Z0-9_-]}")
|
||||
if [[ -n "$descr" && "$descr" != ': : ' ]]; then
|
||||
cache+=( "${(@)^tmp}${descr}" )
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue