From 3703514ed78ed2a92b1659fe082042b93445ab62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kim=20Silkeb=C3=A6kken?= Date: Tue, 22 Jan 2013 11:26:33 +0100 Subject: [PATCH] Add option to set soft divider highlighting group Closes #89. --- powerline/renderer.py | 4 +++- powerline/segment.py | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/powerline/renderer.py b/powerline/renderer.py index 055b5166..50490f16 100644 --- a/powerline/renderer.py +++ b/powerline/renderer.py @@ -96,7 +96,9 @@ class Renderer(object): segment_hl = '' if render_highlighted: - if divider_type == 'hard': + if divider_type == 'soft' and segment['divider_highlight_group'] is not None: + divider_hl = self.hl(segment['divider_highlight'][mode]['fg'], segment['divider_highlight'][mode]['bg'], False) + elif divider_type == 'hard': divider_hl = self.hl(segment['highlight'][mode]['bg'], compare_segment['highlight'][mode]['bg'], False) segment_hl = self.hl(**segment['highlight'][mode]) diff --git a/powerline/segment.py b/powerline/segment.py index 0c27b816..9d634104 100644 --- a/powerline/segment.py +++ b/powerline/segment.py @@ -35,11 +35,14 @@ class Segment(object): raise TypeError('Unknown segment type: {0}'.format(segment_type)) contents, contents_func, key = get_segment_info(segment) highlight_group = segment.get('highlight_group', segment.get('name')) + divider_highlight_group = segment.get('divider_highlight_group') return { 'key': key, 'type': segment_type, 'highlight_group': highlight_group, 'highlight': self.colorscheme.get_group_highlighting(highlight_group), + 'divider_highlight_group': divider_highlight_group, + 'divider_highlight': self.colorscheme.get_group_highlighting(divider_highlight_group) if divider_highlight_group else None, 'before': segment.get('before', ''), 'after': segment.get('after', ''), 'contents_func': contents_func,