diff --git a/powerline/config_files/themes/vim/default.json b/powerline/config_files/themes/vim/default.json index ff206cf2..afbd40b9 100644 --- a/powerline/config_files/themes/vim/default.json +++ b/powerline/config_files/themes/vim/default.json @@ -33,6 +33,7 @@ }, { "name": "file_vcs_status", + "before": " ", "draw_divider": false }, { diff --git a/powerline/segments/vim.py b/powerline/segments/vim.py index 3a993d96..363c436c 100644 --- a/powerline/segments/vim.py +++ b/powerline/segments/vim.py @@ -282,7 +282,6 @@ def file_vcs_status(segment_info): 'contents': status, 'highlight_group': ['file_vcs_status_' + status, 'file_vcs_status'], }) - ret[0]['before'] = ' ' return ret return None diff --git a/powerline/theme.py b/powerline/theme.py index a441e55a..4ca0289e 100644 --- a/powerline/theme.py +++ b/powerline/theme.py @@ -63,8 +63,17 @@ class Theme(object): if contents is None: continue if isinstance(contents, list): + segment_base = copy(segment) + if contents: + for key in ('before', 'after'): + try: + contents[0][key] = segment_base.pop(key) + segment_base[key] = '' + except KeyError: + pass + for subsegment in contents: - segment_copy = copy(segment) + segment_copy = copy(segment_base) segment_copy.update(subsegment) parsed_segments.append(segment_copy) else: