parent
6fc7d6acc9
commit
2a3911dbe6
|
@ -3,14 +3,15 @@
|
|||
"term_24bit_colors": false,
|
||||
"dividers": {
|
||||
"left": {
|
||||
"hard": "",
|
||||
"soft": ""
|
||||
"hard": " ",
|
||||
"soft": " "
|
||||
},
|
||||
"right": {
|
||||
"hard": "",
|
||||
"soft": ""
|
||||
"hard": " ",
|
||||
"soft": " "
|
||||
}
|
||||
}
|
||||
},
|
||||
"spaces": 1
|
||||
},
|
||||
"ext": {
|
||||
"ipython": {
|
||||
|
|
|
@ -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'] * ' ')
|
||||
|
|
|
@ -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']:
|
||||
|
|
Loading…
Reference in New Issue