Add auto_rewrite method to pre_0_11

It raises error without this.
This commit is contained in:
ZyX 2013-02-09 22:27:34 +04:00 committed by Kim Silkebækken
parent d414a7e491
commit 2d9dd21a70
1 changed files with 6 additions and 0 deletions

View File

@ -10,6 +10,12 @@ class PowerlinePrompt(BasePrompt):
def set_p_str(self):
self.p_str, self.p_str_nocolor = self.powerline.renderer.render(output_raw=True)
self.nrspaces = len(self.rspace.search(self.p_str_nocolor).group())
self.prompt_text_len = len(self.p_str_nocolor) - self.nrspaces - 1
def auto_rewrite(self):
# TODO color this
return '%s>%s' % ('-'*self.prompt_text_len, ' '*self.nrspaces)
def setup(prompt='1'):