diff --git a/powerline/config_files/config.json b/powerline/config_files/config.json index 93ac8b4c..e2ae7c13 100644 --- a/powerline/config_files/config.json +++ b/powerline/config_files/config.json @@ -3,14 +3,15 @@ "term_24bit_colors": false, "dividers": { "left": { - "hard": "", - "soft": "" + "hard": " ", + "soft": " " }, "right": { - "hard": "", - "soft": "" + "hard": " ", + "soft": " " } - } + }, + "spaces": 1 }, "ext": { "ipython": { diff --git a/powerline/renderer.py b/powerline/renderer.py index 8c95721f..75ec745a 100644 --- a/powerline/renderer.py +++ b/powerline/renderer.py @@ -104,6 +104,7 @@ class Renderer(object): divider_type = 'soft' if compare_segment['highlight'][mode]['bg'] == segment['highlight'][mode]['bg'] else 'hard' divider_raw = theme.get_divider(segment['side'], divider_type) + divider_spaces = theme.get_spaces() divider_highlighted = '' contents_raw = segment['contents'] contents_highlighted = '' @@ -111,11 +112,9 @@ class Renderer(object): # Pad segments first if segment['draw_divider'] or (divider_type == 'hard' and segment['width'] != 'auto'): if segment['side'] == 'left': - contents_raw = outer_padding + (segment['_space_left'] * ' ') + contents_raw + (segment['_space_right'] * ' ') + ' ' - divider_raw = divider_raw + ' ' + contents_raw = outer_padding + (segment['_space_left'] * ' ') + contents_raw + ((divider_spaces + segment['_space_right']) * ' ') else: - contents_raw = ' ' + (segment['_space_left'] * ' ') + contents_raw + (segment['_space_right'] * ' ') + outer_padding - divider_raw = ' ' + divider_raw + contents_raw = ((divider_spaces + segment['_space_left']) * ' ') + contents_raw + (segment['_space_right'] * ' ') + outer_padding else: if segment['side'] == 'left': contents_raw = outer_padding + (segment['_space_left'] * ' ') + contents_raw + (segment['_space_right'] * ' ') diff --git a/powerline/theme.py b/powerline/theme.py index 4ca0289e..965ef81b 100644 --- a/powerline/theme.py +++ b/powerline/theme.py @@ -20,6 +20,7 @@ class Theme(object): def __init__(self, ext, colorscheme, theme_config, common_config, segment_info=None): self.colorscheme = colorscheme self.dividers = theme_config.get('dividers', common_config['dividers']) + self.spaces = theme_config.get('spaces', common_config['spaces']) self.segments = { 'left': [], 'right': [], @@ -37,6 +38,9 @@ class Theme(object): '''Return segment divider.''' return self.dividers[side][type] + def get_spaces(self): + return self.spaces + def add_highlight(self, segment): segment['highlight'] = self.colorscheme.get_group_highlighting(segment['highlight_group']) if segment['divider_highlight_group']: