Merge remote-tracking branch 'zyx-i/fix-391' into develop

This commit is contained in:
Kim Silkebækken 2013-04-04 14:49:50 +02:00
commit dc1e646308
3 changed files with 9 additions and 8 deletions

View File

@ -67,7 +67,12 @@ class Renderer(object):
return segment
def get_segment_info(self, segment_info):
return segment_info or self.segment_info
r = self.segment_info.copy()
if segment_info:
r.update(segment_info)
if 'PWD' in r['environ']:
r['getcwd'] = lambda: r['environ']['PWD']
return r
def render(self, mode=None, width=None, side=None, output_raw=False, segment_info=None, matcher_info=None):
'''Render all segments.

View File

@ -19,13 +19,6 @@ class ShellRenderer(Renderer):
tmux_escape = False
screen_escape = False
def get_segment_info(self, segment_info):
r = self.segment_info.copy()
r.update(segment_info)
if 'PWD' in r['environ']:
r['getcwd'] = lambda: r['environ']['PWD']
return r
def hlstyle(self, fg=None, bg=None, attr=None):
'''Highlight a segment.

View File

@ -65,6 +65,9 @@ class VimRenderer(Renderer):
def strwidth(string):
return vim.strwidth(string)
def get_segment_info(self, segment_info):
return segment_info or self.segment_info
def render(self, window_id, winidx, current):
'''Render all segments.'''
if current: