Current sum() of once computed _len’s is completely inappropriate in case
removal of the segment caused change in divider lengths: addition or removal of
dividers or change of the divider type when dividers have different length.
Also contains some optimizations: first of all _render_segments is called only
once always, same for strwidth() function for each string. Space is considired
to always have length 1. And do not bother computing any length if no width was
specified.
Most of the files are empty and need to be copied or rewritten from the
old docs. Font patching docs have been removed entirely and will be
moved to the powerline-fontpatcher repo.
Ref #769
Note: this shell script is still faster then client/powerline.py. `time` reports
0.00, 0.01, 0.02÷0.03 for powerline, powerline.sh and powerline.py
respectively (run with `./client/powerline* tmux right`).
Note: does not work in busybox as env there does not support -0 argument.
Requires sed, id (for dash as $UID is not available there), env, printf
and socat. Is not currently handled by setup.py.
Minor changes have been applied:
- Removed copyright info and GPL 3 license since Powerline is MIT (needs
confirmation from kovidgoyal before merge)
- The `powerline-client` script is renamed to `powerline`, and calls the
daemon or `powerline-render` (the previous `powerline`) to render
a statusline
- Minor coding style corrections to match the rest of the project
- Python 3 support is removed for now due to setuptools failing with
binary scripts
Todo:
- Automatically attempt to launch powerline-daemon the first time
powerline is run if the daemon isn't already running?
- pip install -e fails with binary files (it appears that pip recodes
the powerline binary to ASCII, the compiled powerline script must be
copied manually to ~/.local/bin after pip install -e has been run)