1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-11-11 00:00:06 +00:00

fix ruler color on ZSH 5.1

This commit is contained in:
romkatv 2019-07-06 21:17:43 +02:00
parent db86868a22
commit bb4e9d4a5a

View file

@ -2677,13 +2677,13 @@ _p9k_init() {
if (( _P9K_RETVAL == 1 && $#ruler_char == 1 )); then
_p9k_color "" prompt_ruler BACKGROUND
_p9k_background $_P9K_RETVAL
_P9K_LEFT_PREFIX+=$_P9K_RETVAL
_P9K_LEFT_PREFIX+=%b$_P9K_RETVAL
_p9k_color "" prompt_ruler FOREGROUND
_p9k_foreground $_P9K_RETVAL
_P9K_LEFT_PREFIX+=$_P9K_RETVAL
[[ $ruler_char == '.' ]] && local sep=',' || local sep='.'
local ruler_len='${$((COLUMNS-_P9K_IND))/#-*/0}'
_P9K_LEFT_PREFIX+="%b\${(pl$sep$ruler_len$sep$sep${(q)ruler_char}$sep)}%k%f"
_P9K_LEFT_PREFIX+="\${(pl$sep$ruler_len$sep$sep${(q)ruler_char}$sep)}%k%f"
_P9K_LEFT_PREFIX+='$_P9K_T[$((5+!_P9K_IND))]'
else
print -P "%F{red}WARNING!%f %BPOWERLEVEL9K_RULER_CHAR%b is not one character long. Ruler won't be rendered."