aboutsummaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
authorromkatv <roman.perepelitsa@gmail.com>2019-07-11 22:11:38 +0300
committerromkatv <roman.perepelitsa@gmail.com>2019-07-11 22:11:38 +0300
commit0ad3a452ef4c495f26ef656ccd7911510804178c (patch)
tree83c127afc782e40d8af38008a3068de766cc2ae5 /internal
parent3881677ed841a8af89d5b7a13d6f0e7ee7a44112 (diff)
bug fix: never render subsegment separator with the same fg and bg
Diffstat (limited to 'internal')
-rwxr-xr-xinternal/p10k.zsh20
1 files changed, 14 insertions, 6 deletions
diff --git a/internal/p10k.zsh b/internal/p10k.zsh
index a10e8a86..c05ae905 100755
--- a/internal/p10k.zsh
+++ b/internal/p10k.zsh
@@ -286,8 +286,12 @@ left_prompt_segment() {
local t=$#_P9K_T
_P9K_T+=$start_sep$style$left_space # 1
_P9K_T+=$style # 2
- if [[ -z $fg_color ]]; then
- _p9k_foreground $DEFAULT_COLOR
+ if [[ -n $fg_color && $fg_color == $bg_color ]]; then
+ if [[ $fg_color == $DEFAULT_COLOR ]]; then
+ _p9k_foreground $DEFAULT_COLOR_INVERTED
+ else
+ _p9k_foreground $DEFAULT_COLOR
+ fi
_P9K_T+=%b$bg$_P9K_RETVAL$ss$style$left_space # 3
else
_P9K_T+=%b$bg$fg$ss$style$left_space # 3
@@ -443,11 +447,15 @@ right_prompt_segment() {
local t=$#_P9K_T
_P9K_T+=$start_sep$style$left_space # 1
_P9K_T+=$w$style # 2
- if [[ -z $fg_color ]]; then
- _p9k_foreground $DEFAULT_COLOR
- _P9K_T+=$w%b$bg$_P9K_RETVAL$subsep$style$left_space # 3
+ if [[ -n $fg_color && $fg_color == $bg_color ]]; then
+ if [[ $fg_color == $DEFAULT_COLOR ]]; then
+ _p9k_foreground $DEFAULT_COLOR_INVERTED
+ else
+ _p9k_foreground $DEFAULT_COLOR
+ fi
+ _P9K_T+=$w$_P9K_RETVAL$subsep$style$left_space # 3
else
- _P9K_T+=$w%b$bg$fg$subsep$style$left_space # 3
+ _P9K_T+=$w$fg$subsep$style$left_space # 3
fi
_P9K_T+=$w%F{$bg_color}$sep$style$left_space # 4