Remove 'before' key from file_vcs_status segment

Fixes #219
This commit is contained in:
ZyX 2013-02-15 08:30:07 +04:00 committed by Kim Silkebækken
parent 0fddb24b9b
commit df7d0f2041
3 changed files with 11 additions and 2 deletions

View File

@ -33,6 +33,7 @@
},
{
"name": "file_vcs_status",
"before": " ",
"draw_divider": false
},
{

View File

@ -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

View File

@ -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: