diff options
author | Roman Perepelitsa <roman.perepelitsa@gmail.com> | 2020-09-01 14:31:05 +0300 |
---|---|---|
committer | Roman Perepelitsa <roman.perepelitsa@gmail.com> | 2020-09-01 14:31:05 +0300 |
commit | 3b2f474c9f1e087ed1a2d967d3875a2e1df7bb2e (patch) | |
tree | 555ea341574b30df981b828a09d1eaa1c9ad1fa7 /internal | |
parent | 47c842fe8e666e718c8ea805586fe30d0038c262 (diff) |
support generic POWERLEVEL9K_* parameters for segments with dashes in their names
Diffstat (limited to 'internal')
-rw-r--r-- | internal/p10k.zsh | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 2cba7c60..c91656d0 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -467,7 +467,7 @@ _p9k_param() { if [[ -n $_p9k__ret ]]; then _p9k__ret[-1,-1]='' else - if [[ $1 == (#b)prompt_([a-z0-9_]#)(*) ]]; then + if [[ ${1//-/_} == (#b)prompt_([a-z0-9_]#)(*) ]]; then local var=_POWERLEVEL9K_${(U)match[1]}$match[2]_$2 if (( $+parameters[$var] )); then _p9k__ret=${(P)var} @@ -7839,7 +7839,7 @@ function _p9k_init_cacheable() { local -i i=0 for i in {1..$#_p9k_line_segments_left}; do - for elem in ${${(@0)_p9k_line_segments_left[i]}%_joined}; do + for elem in ${${${(@0)_p9k_line_segments_left[i]}%_joined}//-/_}; do local var=POWERLEVEL9K_${(U)elem}_SHOW_ON_COMMAND (( $+parameters[$var] )) || continue _p9k_show_on_command+=( @@ -7847,7 +7847,7 @@ function _p9k_init_cacheable() { $((1+_p9k_display_k[$i/left/$elem])) _p9k__${i}l$elem) done - for elem in ${${(@0)_p9k_line_segments_right[i]}%_joined}; do + for elem in ${${${(@0)_p9k_line_segments_right[i]}%_joined}//-/_}; do local var=POWERLEVEL9K_${(U)elem}_SHOW_ON_COMMAND (( $+parameters[$var] )) || continue local cmds=(${(P)var}) |