aboutsummaryrefslogtreecommitdiff
path: root/internal/p10k.zsh
diff options
context:
space:
mode:
authorromkatv <roman.perepelitsa@gmail.com>2019-08-19 13:18:11 +0300
committerromkatv <roman.perepelitsa@gmail.com>2019-08-19 13:18:11 +0300
commit925ade3d2946cdf7343a093d91ed0849d5aad693 (patch)
tree56c669ffe8a67f7d5f0ac47cd0e1aa1cc07a921d /internal/p10k.zsh
parent3434c0e0a92c7b4840782fff5d4532dff9f290ee (diff)
make ZLE_RPROMPT_INDENT emulation condition less strict
Diffstat (limited to 'internal/p10k.zsh')
-rwxr-xr-xinternal/p10k.zsh15
1 files changed, 12 insertions, 3 deletions
diff --git a/internal/p10k.zsh b/internal/p10k.zsh
index 3b7897ca..7ba7b69d 100755
--- a/internal/p10k.zsh
+++ b/internal/p10k.zsh
@@ -3934,6 +3934,13 @@ _p9k_init_lines() {
fi
}
+_p9k_all_params_eq() {
+ local key
+ for key in ${parameters[(I)${~1}]}; do
+ [[ ${(P)key} == $2 ]] || return
+ done
+}
+
_p9k_init_prompt() {
_p9k_init_lines
@@ -3958,9 +3965,11 @@ _p9k_init_prompt() {
# If affects most terminals when RPROMPT is non-empty and ZLE_RPROMPT_INDENT is zero.
# We can work around it as long as RPROMPT ends with a space.
if [[ -n $_p9k_line_segments_right[-1] && $_p9k_line_never_empty_right[-1] == 0 &&
- $ZLE_RPROMPT_INDENT == 0 && ${POWERLEVEL9K_WHITESPACE_BETWEEN_RIGHT_SEGMENTS:- } == ' ' &&
- -z "$(typeset -m 'POWERLEVEL9K_*(RIGHT_RIGHT_WHITESPACE|RIGHT_PROMPT_LAST_SEGMENT_END_SYMBOL)')" ]] &&
- ! is-at-least 5.7.2; then
+ $ZLE_RPROMPT_INDENT == 0 ]] &&
+ _p9k_all_params_eq 'POWERLEVEL9K_*WHITESPACE_BETWEEN_RIGHT_SEGMENTS' ' ' &&
+ _p9k_all_params_eq 'POWERLEVEL9K_*RIGHT_RIGHT_WHITESPACE' ' ' &&
+ _p9k_all_params_eq 'POWERLEVEL9K_*RIGHT_PROMPT_LAST_SEGMENT_END_SYMBOL' '' &&
+ ! is-at-least 5.7.2; then
_p9k_emulate_zero_rprompt_indent=1
_p9k_prompt_prefix_left+='${${:-${_p9k_real_zle_rprompt_indent:=$ZLE_RPROMPT_INDENT}${ZLE_RPROMPT_INDENT::=1}${_p9k_ind::=0}}+}'
_p9k_line_suffix_right[-1]='${_p9k_sss:+${_p9k_sss% }%E}'