Fix hard divider rendering issue
Hard dividers (for segments with different background colors) are now always drawn, regardless of the draw_divider option, because it looks horrible when segments with different bg colors don't have a divider between them. This resolves an issue with the filename and modified flag in the default theme where the filename segment had to set the draw_divider flag based on the contents of the modified flag to be rendered correctly.
This commit is contained in:
parent
34da25418c
commit
6a9bb45157
|
@ -158,11 +158,11 @@ def statusline(winnr):
|
|||
mksegment(windata['branch'], 250, 240, priority=60),
|
||||
mksegment(windata['readonly'], 196, 240, draw_divider=False),
|
||||
mksegment(windata['filepath'], 250, 240, draw_divider=False, priority=40),
|
||||
mksegment(windata['filename'], windata['filename_color'], 240, attr=Powerline.ATTR_BOLD, draw_divider=not len(windata['modified'])),
|
||||
mksegment(windata['filename'], windata['filename_color'], 240, attr=Powerline.ATTR_BOLD, draw_divider=False),
|
||||
mksegment(windata['modified'], 220, 240, attr=Powerline.ATTR_BOLD),
|
||||
mksegment(windata['currenttag'], 246, 236, draw_divider=False, priority=100),
|
||||
mksegment(filler=True, cterm_fg=236, cterm_bg=236),
|
||||
mksegment(windata['fileformat'], 247, 236, side='r', priority=50),
|
||||
mksegment(windata['fileformat'], 247, 236, side='r', priority=50, draw_divider=False),
|
||||
mksegment(windata['fileencoding'], 247, 236, side='r', priority=50),
|
||||
mksegment(windata['filetype'], 247, 236, side='r', priority=50),
|
||||
mksegment(windata['line_percent'], windata['line_percent_color'], 240, side='r', priority=30),
|
||||
|
|
|
@ -81,10 +81,10 @@ class Powerline(object):
|
|||
if segment['filler']:
|
||||
# Filler segments shouldn't be padded
|
||||
rendered_highlighted += segment['contents']
|
||||
elif segment['draw_divider'] and (divider_type == 'hard' or segment['side'] == compare['side']):
|
||||
# Draw divider if specified, and if the next segment is on
|
||||
# the opposite side only draw the divider if it's a hard
|
||||
# divider
|
||||
elif segment['draw_divider'] or divider_type == 'hard':
|
||||
# Draw divider if specified, or if it's a hard divider
|
||||
# Note: Hard dividers are always drawn, regardless of
|
||||
# the draw_divider option
|
||||
if segment['side'] == 'l':
|
||||
segment['rendered_raw'] += outer_padding + segment['contents'] + ' ' + divider + ' '
|
||||
rendered_highlighted += segment_hl + outer_padding + segment['contents'] + ' ' + divider_hl + divider + ' '
|
||||
|
|
Loading…
Reference in New Issue