summaryrefslogtreecommitdiff
path: root/internal/p10k.zsh
diff options
context:
space:
mode:
authorromkatv <roman.perepelitsa@gmail.com>2019-10-19 09:35:28 +0300
committerromkatv <roman.perepelitsa@gmail.com>2019-10-19 09:35:28 +0300
commit4536dc2a2724cfd1a07144ad36a65dc7c94cc388 (patch)
treeadf39e17426d41bdd90c1d684ffa37b23abce62a /internal/p10k.zsh
parent41084c089e4fc5a3f1b2da75e18cf0711864275c (diff)
parentaa539022816d3ebc7b210c5ab06c5c205fb2306b (diff)
Merge branch 'master' into instant-prompt
Diffstat (limited to 'internal/p10k.zsh')
-rw-r--r--internal/p10k.zsh11
1 files changed, 5 insertions, 6 deletions
diff --git a/internal/p10k.zsh b/internal/p10k.zsh
index c2506a0a..97ccb271 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
@@ -457,11 +457,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() {