Fix rendering of dividers without custom highlight group

This commit is contained in:
Kim Silkebækken 2013-01-31 07:51:09 +01:00
parent 7022b47ed9
commit fd5cd92101
1 changed files with 8 additions and 4 deletions

View File

@ -133,10 +133,14 @@ class Renderer(object):
# Apply highlighting to padded dividers and contents # Apply highlighting to padded dividers and contents
if render_highlighted: if render_highlighted:
if divider_type == 'soft' and segment['divider_highlight_group'] is not None: if divider_type == 'soft':
divider_highlighted = self.hl(divider_raw, segment['divider_highlight'][mode]['fg'], segment['divider_highlight'][mode]['bg'], False) divider_highlight_group_key = 'highlight' if segment['divider_highlight_group'] is None else 'divider_highlight'
elif divider_type == 'hard': divider_fg = segment[divider_highlight_group_key][mode]['fg']
divider_highlighted = self.hl(divider_raw, segment['highlight'][mode]['bg'], compare_segment['highlight'][mode]['bg'], False) divider_bg = segment[divider_highlight_group_key][mode]['bg']
else:
divider_fg = segment['highlight'][mode]['bg']
divider_bg = compare_segment['highlight'][mode]['bg']
divider_highlighted = self.hl(divider_raw, divider_fg, divider_bg, False)
contents_highlighted = self.hl(self.escape(contents_raw), **segment['highlight'][mode]) contents_highlighted = self.hl(self.escape(contents_raw), **segment['highlight'][mode])
# Append padded raw and highlighted segments to the rendered segment variables # Append padded raw and highlighted segments to the rendered segment variables