1
0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-12-12 19:18:28 +02:00

Fix icons cut off in some terminal emulators

This commit is contained in:
Yang Tang 2018-06-01 11:49:23 -04:00
parent 0e3c1924fe
commit 2f95fd04d9

View File

@ -156,12 +156,12 @@ left_prompt_segment() {
if [[ -n $6 ]]; then if [[ -n $6 ]]; then
visual_identifier="$(print_icon $6)" visual_identifier="$(print_icon $6)"
if [[ -n "$visual_identifier" ]]; then if [[ -n "$visual_identifier" ]]; then
# Add an whitespace if we print more than just the visual identifier
[[ -n "$5" ]] && visual_identifier="$visual_identifier "
# Allow users to overwrite the color for the visual identifier only. # Allow users to overwrite the color for the visual identifier only.
local visual_identifier_color_variable=POWERLEVEL9K_${(U)1#prompt_}_VISUAL_IDENTIFIER_COLOR local visual_identifier_color_variable=POWERLEVEL9K_${(U)1#prompt_}_VISUAL_IDENTIFIER_COLOR
set_default $visual_identifier_color_variable $4 set_default $visual_identifier_color_variable $4
visual_identifier="%F{${(P)visual_identifier_color_variable}%}$visual_identifier%f" visual_identifier="%F{${(P)visual_identifier_color_variable}%}$visual_identifier%f"
# Add an whitespace if we print more than just the visual identifier
[[ -n "$5" ]] && visual_identifier="$visual_identifier "
fi fi
fi fi
@ -240,12 +240,12 @@ right_prompt_segment() {
if [[ -n "$6" ]]; then if [[ -n "$6" ]]; then
visual_identifier="$(print_icon $6)" visual_identifier="$(print_icon $6)"
if [[ -n "$visual_identifier" ]]; then if [[ -n "$visual_identifier" ]]; then
# Add an whitespace if we print more than just the visual identifier
[[ -n "$5" ]] && visual_identifier=" $visual_identifier"
# Allow users to overwrite the color for the visual identifier only. # Allow users to overwrite the color for the visual identifier only.
local visual_identifier_color_variable=POWERLEVEL9K_${(U)1#prompt_}_VISUAL_IDENTIFIER_COLOR local visual_identifier_color_variable=POWERLEVEL9K_${(U)1#prompt_}_VISUAL_IDENTIFIER_COLOR
set_default $visual_identifier_color_variable $4 set_default $visual_identifier_color_variable $4
visual_identifier="%F{${(P)visual_identifier_color_variable}%}$visual_identifier%f" visual_identifier="%F{${(P)visual_identifier_color_variable}%}$visual_identifier%f"
# Add an whitespace if we print more than just the visual identifier
[[ -n "$5" ]] && visual_identifier=" $visual_identifier"
fi fi
fi fi