Commit Graph

2 Commits

Author SHA1 Message Date
Kim Silkebækken bef6c430ad Update vim statusline example
Now the vim statusline example does everything in Python, so the python
example isn't required anymore.
2012-11-14 20:45:47 +01:00
Kim Silkebækken b5d72afb7b Create dynamic vim statusline example
This example only does a single type of highlighting (normal mode) but
demonstrates nicely how rendering a statusline with Python could work.
This also utilizes the new width functionality to crop away less
important segment if the window is too small, and do the padding with
Python instead of using vim's split segment.

Some optimization will probably be necessary, as calling Python for each
statusline redraw is quite expensive. A solution could be evaluating the
segments in Python once and then calculating the width and crop away/pad
the segments, and then sending the statusline with unevaluated segments
to vim for rendering without calling Python. Only some events (like
CursorHold, InsertEnter/InsertLeave, etc.) would trigger a re-render
with Python, a recalculation of the width and cropping/padding.
2012-11-14 20:30:02 +01:00