For some reason the statusline doesn't always get redrawn automatically
after setting the statusline property for a window, and running
:redrawstatus when a buffer or window is entered seems to resolve this
issue.
Theme.get_segments() is now a generator which returns segment copies,
and it no longer handles segment content replacement.
Renderer.render() accepts a theme and a segments parameter in order to
override the default actions (calling self.get_theme() and
self.get_segments()). This is necessary to be able to cache themes and
segment contents somewhere else and provide the cached data to the
render method. The render method now also handles removing excluded
segments, which was previously handled in Theme.get_segments().
Finally, VimRenderer.render() caches all theme and segment data and
provides this data to the renderer for non-current windows.
Closes#12.
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.