From b23ea8322a417603306911bcacaaf3e615cc3235 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sat, 22 Nov 2014 22:53:42 +0300 Subject: [PATCH] Support ZLE_RPROMPT_INDENT Fixes #1145 --- powerline/bindings/zsh/__init__.py | 6 +++++- powerline/bindings/zsh/powerline.zsh | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/powerline/bindings/zsh/__init__.py b/powerline/bindings/zsh/__init__.py index 693f5186..d982c5b6 100644 --- a/powerline/bindings/zsh/__init__.py +++ b/powerline/bindings/zsh/__init__.py @@ -142,10 +142,14 @@ class Prompt(object): } zsh.setvalue('_POWERLINE_PARSER_STATE', None) zsh.setvalue('_POWERLINE_SHORTENED_PATH', None) + try: + zle_rprompt_indent = zsh.getvalue('ZLE_RPROMPT_INDENT') + except IndexError: + zle_rprompt_indent = 1 r = '' if self.above: for line in self.powerline.render_above_lines( - width=zsh.columns() - 1, + width=zsh.columns() - zle_rprompt_indent, segment_info=segment_info, ): r += line + '\n' diff --git a/powerline/bindings/zsh/powerline.zsh b/powerline/bindings/zsh/powerline.zsh index be8422bf..f869cccd 100644 --- a/powerline/bindings/zsh/powerline.zsh +++ b/powerline/bindings/zsh/powerline.zsh @@ -144,7 +144,7 @@ _powerline_setup_prompt() { new_args_2+=' --renderer_arg="local_theme=continuation"' local add_args_3=$add_args' --renderer_arg="local_theme=select"' local add_args_2=$add_args$new_args_2 - add_args+=' --width=$(( ${COLUMNS:-$(_powerline_columns_fallback)} - 1 ))' + add_args+=' --width=$(( ${COLUMNS:-$(_powerline_columns_fallback)} - ${ZLE_RPROMPT_INDENT:-1} ))' local add_args_r2=$add_args$new_args_2 PS1='$($=POWERLINE_COMMAND shell aboveleft '$add_args')' RPS1='$($=POWERLINE_COMMAND shell right '$add_args')'