1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-12-26 00:41:57 +00:00

get rid of captures

This commit is contained in:
romkatv 2020-01-12 09:43:42 +01:00
parent 6e3711759f
commit 770bf93444

View file

@ -145,11 +145,16 @@ function _parse_buffer() {
local -r id='(<->|[[:alpha:]_][[:IDENT:]]#)' local -r id='(<->|[[:alpha:]_][[:IDENT:]]#)'
local -r var="\$$id|\${$id}|\"\$$id\"|\"\${$id}\"" local -r var="\$$id|\${$id}|\"\$$id\"|\"\${$id}\""
local -i e c=32 local -i e ic c=1024
local skip n s r state local skip n s r state
local -a aln alp alf v commands match mbegin mend local -a aln alp alf v commands
[[ -o interactive_comments ]] && local tokens=(${(Z+C+)1}) || local tokens=(${(z)1}) if [[ -o interactive_comments ]]; then
ic=1
local tokens=(${(Z+C+)1})
else
local tokens=(${(z)1})
fi
() { () {
while (( $#tokens )); do while (( $#tokens )); do
@ -171,25 +176,26 @@ function _parse_buffer() {
tokens[1]=() tokens[1]=()
if (( $+galiases[$token] )); then if (( $+galiases[$token] )); then
(( $aln[(eI)p$token] )) && break (( $aln[(eI)p$token] )) && break
n=p$token
s=$galiases[$token] s=$galiases[$token]
n=p$token
elif (( e )); then elif (( e )); then
break break
elif (( $+aliases[$token] )); then elif (( $+aliases[$token] )); then
(( $aln[(eI)p$token] )) && break (( $aln[(eI)p$token] )) && break
n=p$token
s=$aliases[$token] s=$aliases[$token]
elif [[ $token == (#b)?*.(?*) ]] && (( $+saliases[$match[1]] )); then n=p$token
(( $aln[(eI)s$match[1]] )) && break elif [[ $token == ?*.?* ]] && (( $+saliases[${token##*.}] )); then
n=s$match[1] r=${token##*.}
s=${saliases[$match[1]]%% #} (( $aln[(eI)s$r] )) && break
s=${saliases[$r]%% #}
n=s$r
else else
break break
fi fi
aln+=$n aln+=$n
alp+=$#tokens alp+=$#tokens
[[ $s == *' ' ]] && alf+=$#tokens [[ $s == *' ' ]] && alf+=$#tokens
[[ -o interactive_comments ]] && tokens[1,0]=(${(Z+C+)s}) || tokens[1,0]=(${(z)s}) (( ic )) && tokens[1,0]=(${(Z+C+)s}) || tokens[1,0]=(${(z)s})
done done
case $state in case $state in