Merge remote-tracking branch 'zyx-i/fix-391' into develop
This commit is contained in:
commit
dc1e646308
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue