aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Hilburn <bhilburn@gmail.com>2015-11-18 21:54:21 +0300
committerBen Hilburn <bhilburn@gmail.com>2015-11-18 21:54:21 +0300
commite79a2ffff002a373f79ee25147df92411d174b26 (patch)
treebf0ed83024d7d7da7436775350860d1416d3c230
parentb83cfd7515d5d6c0feaa9915f1a89a5d45a2c689 (diff)
parent47eb8f10ac798cada32e91613bdcde8a44378a2f (diff)
Merge pull request #149 from Tritlo/master
Now allowing the RPROMPT to be on a newline.
-rwxr-xr-xpowerlevel9k.zsh-theme21
1 files changed, 13 insertions, 8 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme
index cdcb9a96..d71a5cf0 100755
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -702,14 +702,19 @@ powerlevel9k_prepare_prompts() {
if [[ "$POWERLEVEL9K_PROMPT_ON_NEWLINE" == true ]]; then
PROMPT="$(print_icon 'MULTILINE_FIRST_PROMPT_PREFIX')%{%f%b%k%}$(build_left_prompt)
$(print_icon 'MULTILINE_SECOND_PROMPT_PREFIX')"
- # The right prompt should be on the same line as the first line of the left
- # prompt. To do so, there is just a quite ugly workaround: Before zsh draws
- # the RPROMPT, we advise it, to go one line up. At the end of RPROMPT, we
- # advise it to go one line down. See:
- # http://superuser.com/questions/357107/zsh-right-justify-in-ps1
- local LC_ALL="" LC_CTYPE="en_US.UTF-8" # Set the right locale to protect special characters
- RPROMPT_PREFIX='%{'$'\e[1A''%}' # one line up
- RPROMPT_SUFFIX='%{'$'\e[1B''%}' # one line down
+ if [[ "$POWERLEVEL9K_RPROMPT_ON_NEWLINE" != true ]]; then
+ # The right prompt should be on the same line as the first line of the left
+ # prompt. To do so, there is just a quite ugly workaround: Before zsh draws
+ # the RPROMPT, we advise it, to go one line up. At the end of RPROMPT, we
+ # advise it to go one line down. See:
+ # http://superuser.com/questions/357107/zsh-right-justify-in-ps1
+ local LC_ALL="" LC_CTYPE="en_US.UTF-8" # Set the right locale to protect special characters
+ RPROMPT_PREFIX='%{'$'\e[1A''%}' # one line up
+ RPROMPT_SUFFIX='%{'$'\e[1B''%}' # one line down
+ else
+ RPROMPT_PREFIX=''
+ RPROMPT_SUFFIX=''
+ fi
else
PROMPT="%{%f%b%k%}$(build_left_prompt)"
RPROMPT_PREFIX=''