From f2cd89ed70b9daa0557db946b57f6950fa2c57a9 Mon Sep 17 00:00:00 2001 From: romkatv Date: Sat, 19 Oct 2019 07:40:27 +0200 Subject: work around a bug in zsh that percent-expands `%1F{2}` as if it was `%F{2}`; fixes #270 --- internal/p10k.zsh | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 7849187e..b54add4c 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -91,7 +91,7 @@ function getColorCode() { emulate -L zsh setopt no_hist_expand extended_glob no_prompt_bang prompt_{percent,subst} if (( ARGC == 1 )); then - case $1 in + case $1 in foreground) local k for k in "${(k@)__p9k_colors}"; do @@ -444,11 +444,10 @@ _p9k_background() { } _p9k_foreground() { - case $1 in - '') _p9k_ret="%f";; - '#'*) _p9k_ret="%F{$1}";; - *) _p9k_ret="%${1}F";; - esac + # Note: This code used to produce `%1F` instead of `%F{1}` because it's more efficient. + # Unfortunately, this triggers a bug in zsh. Namely, `%1F{2}` gets percent-expanded as if + # it was `%F{2}`. + [[ -n $1 ]] && _p9k_ret="%F{$1}" || _p9k_ret="%k" } _p9k_escape_style() { -- cgit v1.2.3 From aa539022816d3ebc7b210c5ab06c5c205fb2306b Mon Sep 17 00:00:00 2001 From: romkatv Date: Sat, 19 Oct 2019 08:22:03 +0200 Subject: pull upstream changes from gitstatus --- gitstatus/bin/gitstatusd-darwin-x86_64 | Bin 2095092 -> 2095092 bytes gitstatus/bin/gitstatusd-linux-x86_64 | Bin 2340104 -> 2340104 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/gitstatus/bin/gitstatusd-darwin-x86_64 b/gitstatus/bin/gitstatusd-darwin-x86_64 index fb4e4a02..09eeac8d 100755 Binary files a/gitstatus/bin/gitstatusd-darwin-x86_64 and b/gitstatus/bin/gitstatusd-darwin-x86_64 differ diff --git a/gitstatus/bin/gitstatusd-linux-x86_64 b/gitstatus/bin/gitstatusd-linux-x86_64 index 36691cf4..5538aa05 100755 Binary files a/gitstatus/bin/gitstatusd-linux-x86_64 and b/gitstatus/bin/gitstatusd-linux-x86_64 differ -- cgit v1.2.3