Support ZLE_RPROMPT_INDENT

Fixes #1145
This commit is contained in:
ZyX 2014-11-22 22:53:42 +03:00
parent 4bb4c3f50b
commit b23ea8322a
2 changed files with 6 additions and 2 deletions

View File

@ -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'

View File

@ -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')'