rename _p9k names for easier testing

pull/436/head
romkatv 5 years ago
parent 940e6dc118
commit 6e3711759f

@ -1,4 +1,4 @@
typeset -gA __p9k_pb_cmd_skip=( typeset -gA __pb_cmd_skip=(
'}' '' '}' ''
'|' '' '|' ''
'||' '' '||' ''
@ -37,7 +37,7 @@ typeset -gA __p9k_pb_cmd_skip=(
'foreach' '\(*\)' 'foreach' '\(*\)'
) )
typeset -gA __p9k_pb_precommand=( typeset -gA __pb_precommand=(
'-' '' '-' ''
'builtin' '' 'builtin' ''
'command' '' 'command' ''
@ -53,7 +53,7 @@ typeset -gA __p9k_pb_precommand=(
'sudo' '-[^aghpuUCcrtT]#[aghpuUCcrtT]|--(close-from|group|host|prompt|role|type|other-user|command-timeout|user)' 'sudo' '-[^aghpuUCcrtT]#[aghpuUCcrtT]|--(close-from|group|host|prompt|role|type|other-user|command-timeout|user)'
) )
typeset -gA __p9k_pb_redirect=( typeset -gA __pb_redirect=(
'&>' '' '&>' ''
'>' '' '>' ''
'>&' '' '>&' ''
@ -70,7 +70,7 @@ typeset -gA __p9k_pb_redirect=(
'<<<' '' '<<<' ''
) )
typeset -gA __p9k_pb_term=( typeset -gA __pb_term=(
'|' '' '|' ''
'||' '' '||' ''
';' '' ';' ''
@ -89,7 +89,7 @@ typeset -gA __p9k_pb_term=(
'()' '' '()' ''
) )
typeset -gA __p9k_pb_term_skip=( typeset -gA __pb_term_skip=(
'()' '' '()' ''
'(' '\)' '(' '\)'
';;' '\)|esac' ';;' '\)|esac'
@ -134,13 +134,13 @@ typeset -gA __p9k_pb_term_skip=(
# --------------- # ---------------
# #
# More brokenness with non-standard options (ignore_braces, ignore_close_braces, etc.). # More brokenness with non-standard options (ignore_braces, ignore_close_braces, etc.).
function _p9k_parse_buffer() { function _parse_buffer() {
local rcquotes local rcquotes
[[ -o rcquotes ]] && rcquotes=(-o rcquotes) [[ -o rcquotes ]] && rcquotes=(-o rcquotes)
emulate -L zsh -o extended_glob -o no_nomatch $rcquotes emulate -L zsh -o extended_glob -o no_nomatch $rcquotes
typeset -ga _p9k_buffer_commands=() typeset -ga _buffer_commands=()
local -r id='(<->|[[:alpha:]_][[:IDENT:]]#)' local -r id='(<->|[[:alpha:]_][[:IDENT:]]#)'
local -r var="\$$id|\${$id}|\"\$$id\"|\"\${$id}\"" local -r var="\$$id|\${$id}|\"\$$id\"|\"\${$id}\""
@ -194,10 +194,10 @@ function _p9k_parse_buffer() {
case $state in case $state in
t|p*) t|p*)
if (( $+__p9k_pb_term[$token] )); then if (( $+__pb_term[$token] )); then
skip=$__p9k_pb_term_skip[$token] skip=$__pb_term_skip[$token]
state=${skip:+s} state=${skip:+s}
[[ $token == '()' ]] || _p9k_buffer_commands+=($commands) [[ $token == '()' ]] || _buffer_commands+=($commands)
commands=() commands=()
continue continue
elif [[ $state == t ]]; then elif [[ $state == t ]]; then
@ -222,7 +222,7 @@ function _p9k_parse_buffer() {
continue continue
fi fi
if (( $+__p9k_pb_redirect[${token#<0-255>}] )); then if (( $+__pb_redirect[${token#<0-255>}] )); then
state+=r state+=r
continue continue
fi fi
@ -238,8 +238,8 @@ function _p9k_parse_buffer() {
case $state in case $state in
'') '')
if (( $+__p9k_pb_cmd_skip[$token] )); then if (( $+__pb_cmd_skip[$token] )); then
skip=$__p9k_pb_cmd_skip[$token] skip=$__pb_cmd_skip[$token]
state=${skip:+s} state=${skip:+s}
continue continue
fi fi
@ -269,15 +269,15 @@ function _p9k_parse_buffer() {
esac esac
commands+=$token commands+=$token
if (( $+__p9k_pb_precommand[$commands[-1]] )); then if (( $+__pb_precommand[$commands[-1]] )); then
state=p state=p
skip=$__p9k_pb_precommand[$commands[-1]] skip=$__pb_precommand[$commands[-1]]
else else
state=t state=t
fi fi
done done
} }
_p9k_buffer_commands+=($commands) _buffer_commands+=($commands)
_p9k_buffer_commands=(${(u)_p9k_buffer_commands:#('(('*'))'|'`'*'`'|'$'*)}) _buffer_commands=(${(u)_buffer_commands:#('(('*'))'|'`'*'`'|'$'*)})
} }

Loading…
Cancel
Save