The statusline example mostly works now, even with different modes. The
main problem is still non-current windows, which receive the contents of
the currently active window for most segments.
A major issue is that we currently can't pass any windows' mode on to
the segment rendering method, so non-current windows don't get
highlighted correctly, and segments don't get removed if they have 'nc'
in their exclude_modes setting, and statuslines in non-current windows
don't get resized until the window is focused again.
This class loads all segments from the theme, initializes the highlight
group, assigns all necessary properties based on the JSON theme
configuration, etc. By doing this we basically move the mksegment()
functionality into the theme loader, so this function can be removed at
the cost of making it more complicated to use Powerline without its
theme functionality.
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.
Another rendering pass is necessary before calculating the filler
segment's lengths, because center segments may lose their separators
after removing low-priority segments.
Some unicode and variable assignment issues has been resolved so
everything renders correctly.
This change removes the Segment class as this takes forever to remove
from the segment array when removing low-priority segments. It has
instead been replaced by a wrapper function that works the same and
returns a working dict of all segment properties.
The regex substitution bottleneck in the vim example has been fixed by
using a single-character percent placeholder in vim segments which is
later replaced with a double percent using str.replace().