Reasoning: currently used fallback works well only if relatively recent patches
are there: specifically the one that transforms Vim errors to Python exceptions.
This variant should work in any case, but it has a downside: it does not test
whether function exists, it tests whether argument given to vim_func_exists
denote some callable object (which may as well be global variable with the same
name). When it comes to CapsLockStatusline I do not care much as I am using
`vim.eval` to call it and not saving reference to this function somewhere.
Fixes#1146
One cannot really tell what are things like `Sniffer` or `reader`. It is better
to use `csv` module directly rather than write `from csv import reader as
csv_reader`.
Equivalent to airline csv Christian Brabandt plugin integration, but uses Python
own facilities.
Note: filetype detection is out of the scope of the powerline responsibilities.
CSV is supported by powerline, but only as long as filetype detection is
done by Vim correctly. By default CSV files are neither detected nor
highlighted.
Some known differences between powerline code and @chrisbra plugin with
corresponding airline integration:
1. Detection work differently. I cannot say which is better because I have not
tested it much, but it is definitely different.
2. My variant is able to detect whether there is (no) header. (Of course,
relying on Python code.) Airline is using a setting. (Both do not allow
manual per-filetype setting.) Of course, user can force either variant (no
headers at all or headers always).
3. My variant makes it possible to configure header output format, including
truncating it at 15 characters (the default).
4. CSV plugin does not work with multiline CSV items (in some dialects one can
use code like `abc;"I<CR>am<CR>multiline<CR>string"`). See `:h csv-column` on
how to fix this if possible (will require also changing `<sid>WColumn`
function because currently it only works with one line).
5. AFAIK Python does not such a thing as “fixed width CSV”. Thus I do not work
with this, but CSV plugin does. Not sure whether it is different with
space-separated CSV files though.
Reasoning: I am going to add man pages support to the live ebuild, but it does
not make sense to add this to the 1.0 ebuild previously used as the base. Since
new features will likely continue to appear in the live ebuild powerline-release
script was modified to do the right thing under new circumstances.
In Python-3* it used to show the following:
Traceback (most recent call last):
File "/usr/lib/python-exec/python3.3/powerline-config", line 66, in <module>
args.function(pl, args)
AttributeError: 'Namespace' object has no attribute 'function'
now it shows
usage: powerline-config [-h] {tmux,shell} ...
powerline-config: error: too few arguments
in both python-2.7 and -3.3.
Fixes#1120.