Merge remote-tracking branch 'ytang/fix-icons-cut-off' into staging_065

Conflicts were:
- test/segments/command_execution_time.spec and
test/segments/go_version.spec: All conflicts come from renaming color
names on next (#703) and adding a whitespace to the Visual Identifier
(#854) on master.
pull/22/head
Dominik Ritter 7 years ago
commit d9d9fb9b6b

@ -517,7 +517,7 @@ segment will not be displayed.
| Variable | Default Value | Description | | Variable | Default Value | Description |
|----------|---------------|-------------| |----------|---------------|-------------|
|`POWERLEVEL9K_PUBLIC_IP_FILE`|'/tmp/p8k_public_ip'|This is the file your public IP is cached in.| |`POWERLEVEL9K_PUBLIC_IP_FILE`|'/tmp/p9k_public_ip'|This is the file your public IP is cached in.|
|`POWERLEVEL9K_PUBLIC_IP_HOST`|'http://ident.me'|This is the default host to get your public IP.| |`POWERLEVEL9K_PUBLIC_IP_HOST`|'http://ident.me'|This is the default host to get your public IP.|
|`POWERLEVEL9K_PUBLIC_IP_TIMEOUT`|300|The amount of time in seconds between refreshing your cached IP.| |`POWERLEVEL9K_PUBLIC_IP_TIMEOUT`|300|The amount of time in seconds between refreshing your cached IP.|
|`POWERLEVEL9K_PUBLIC_IP_METHODS`|(dig curl wget)| These methods in that order are used to refresh your IP.| |`POWERLEVEL9K_PUBLIC_IP_METHODS`|(dig curl wget)| These methods in that order are used to refresh your IP.|

@ -156,12 +156,14 @@ 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.
# To avoid cutting off the visual identifier in some terminal emulators (e.g., Konsole, st),
# we need to color both the visual identifier and the whitespace.
[[ -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
@ -241,12 +243,14 @@ 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.
# To avoid cutting off the visual identifier in some terminal emulators (e.g., Konsole, st),
# we need to color both the visual identifier and the whitespace.
[[ -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

Loading…
Cancel
Save