Non-current segments used the wrong contents because outdated
information was cached (self.segments was repopulated in the render()
method which was called *after* the contents was cached). Now the
contents are cached after the parent class' render() method is called so
the correct information is cached.
Closes#11.
Each window is now tagged with an UUID and this UUID is used to cache
the window's statusline contents in the Python VimRenderer in order to
avoid translating the statusline contents to and from a vimdict
unnecessarily.
Refs #11.
When Powerline is installed as a package in the system-wide
site-packages folder it can easily be enabled by adding a simple python
statement to the user's vimrc file.
Otherwise it can be added by doing a :source
path/to/plugin/vim/powerline.vim in vimrc, but the other way of doing it
works without specifying the full path as long as Powerline is installed
somewhere in sys.path.
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.