mirror of
https://github.com/romkatv/powerlevel10k
synced 2024-12-11 16:45:36 +00:00
handle early precommand termination
This commit is contained in:
parent
347392daab
commit
df4b33c699
@ -114,6 +114,10 @@ typeset -gA _p9k_skip_arg=(
|
|||||||
# ---------------
|
# ---------------
|
||||||
# ${x/}
|
# ${x/}
|
||||||
# ---------------
|
# ---------------
|
||||||
|
# - -- x
|
||||||
|
# ---------------
|
||||||
|
# command -p -p x
|
||||||
|
# ---------------
|
||||||
# *
|
# *
|
||||||
# ---------------
|
# ---------------
|
||||||
# x=$y; $x
|
# x=$y; $x
|
||||||
@ -187,14 +191,16 @@ function _p9k_extract_commands() {
|
|||||||
done
|
done
|
||||||
|
|
||||||
case $state in
|
case $state in
|
||||||
t)
|
t|p*)
|
||||||
if (( $+_p9k_term[$token] )); then
|
if (( $+_p9k_term[$token] )); then
|
||||||
skip=$_p9k_skip_arg[$token]
|
skip=$_p9k_skip_arg[$token]
|
||||||
state=${skip:+s}
|
state=${skip:+s}
|
||||||
[[ $token == '()' ]] || _p9k_commands+=($commands)
|
[[ $token == '()' ]] || _p9k_commands+=($commands)
|
||||||
commands=()
|
commands=()
|
||||||
fi
|
continue
|
||||||
continue;;
|
elif [[ $state == t ]]; then
|
||||||
|
continue
|
||||||
|
fi;;
|
||||||
s)
|
s)
|
||||||
if [[ $token == $~skip ]]; then
|
if [[ $token == $~skip ]]; then
|
||||||
state=
|
state=
|
||||||
@ -220,7 +226,6 @@ function _p9k_extract_commands() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $token == *'$'* ]]; then
|
if [[ $token == *'$'* ]]; then
|
||||||
setopt xtrace
|
|
||||||
if [[ $token == $~var ]]; then
|
if [[ $token == $~var ]]; then
|
||||||
n=${${token##[^[:IDENT:]]}%%[^[:IDENT:]]}
|
n=${${token##[^[:IDENT:]]}%%[^[:IDENT:]]}
|
||||||
[[ $token == *'"' ]] && v=("${(@P)n}") || v=(${(P)n})
|
[[ $token == *'"' ]] && v=("${(@P)n}") || v=(${(P)n})
|
||||||
|
Loading…
Reference in New Issue
Block a user