Return empty string for empty sides

This commit is contained in:
Kim Silkebækken 2013-01-22 13:21:54 +01:00
parent b7e7b1e4f7
commit eb141428c6
1 changed files with 4 additions and 1 deletions

View File

@ -82,7 +82,10 @@ class Renderer(object):
''' '''
rendered_highlighted = u'' rendered_highlighted = u''
segments_len = len(segments) segments_len = len(segments)
mode = mode if mode in segments[0]['highlight'] else Colorscheme.DEFAULT_MODE_KEY try:
mode = mode if mode in segments[0]['highlight'] else Colorscheme.DEFAULT_MODE_KEY
except IndexError:
return ''
for index, segment in enumerate(segments): for index, segment in enumerate(segments):
prev_segment = segments[index - 1] if index > 0 else theme.EMPTY_SEGMENT prev_segment = segments[index - 1] if index > 0 else theme.EMPTY_SEGMENT