mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2026-10-01 01:04:29 +00:00
fix heredocs
This commit is contained in:
+19
-7
@@ -198,6 +198,11 @@ function _parse_buffer() {
|
|||||||
(( ic )) && 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
|
||||||
|
|
||||||
|
if [[ $token == '<<'(|-) ]]; then
|
||||||
|
state=h
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
case $state in
|
case $state in
|
||||||
t|p*)
|
t|p*)
|
||||||
if (( $+__pb_term[$token] )); then
|
if (( $+__pb_term[$token] )); then
|
||||||
@@ -218,16 +223,23 @@ function _parse_buffer() {
|
|||||||
state[1]=
|
state[1]=
|
||||||
continue;;
|
continue;;
|
||||||
h)
|
h)
|
||||||
skip=${(b)token}
|
while (( $#tokens )); do
|
||||||
state=s
|
(( e = ${tokens[(i)$token]} ))
|
||||||
|
if [[ $tokens[e-1] == ';' && $tokens[e+1] == ';' ]]; then
|
||||||
|
tokens[1,e]=()
|
||||||
|
break
|
||||||
|
else
|
||||||
|
tokens[1,e]=()
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
while (( $#alp && alp[-1] >= $#tokens )); do
|
||||||
|
aln[-1]=()
|
||||||
|
alp[-1]=()
|
||||||
|
done
|
||||||
|
state=t
|
||||||
continue;;
|
continue;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if [[ $token == '<<'(|-) ]]; then
|
|
||||||
state=h
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
|
|
||||||
if (( $+__pb_redirect[${token#<0-255>}] )); then
|
if (( $+__pb_redirect[${token#<0-255>}] )); then
|
||||||
state+=r
|
state+=r
|
||||||
continue
|
continue
|
||||||
|
|||||||
Reference in New Issue
Block a user