This fixes a bug that causes a mangled statusline. The bug occurs, when
the `displayed_head_limit` variable is set and causes the substring
expression to take a substring, which ends in the middle of a multi-byte
character.
This patch replaces the byte-based methods for measuring the
length of the branch name and creating a substring with methods that are
character-based and multi-byte aware.
It also has the nice side effect of making the length measuring more
accurate, by taking the actual display width of multi-byte characters
and the ambiwidth setting into account.
Since we need to take into account older Vim 7.4 (which might not have
the strcharpart() function), do introduce a compatibility wrapper in
airline#util that checks for the existence of the function before using
it. Older Vims will keep on using the byte-based index. I suppose Vim
7.4 before the strcharpart() function was available (patch 7.4.1730)
shouldn't be in use anymore.
closes#1948
Define the variable :let g:airline_filetype_overrides to allow for
specific customization how a specific filetype will be displayed.
For e.g. a German display, you can use: >
:let g:airline_filetype_overrides = {'help': ['Hilfe', ':%f']}
<
This defines how section a and b will look like for a window with that
specific filetype.
Closes#1888
When `g:skip_empty_sections` is set, `:AirlineRefresh` can be called
very often and cause slow down, because it forcefully re-creates the
highlighting groups. This is mostly not needed for the redraw to happen,
therefore, add the `<bang>` attribute to the command, making it skip to
re-create the highlighting groups and have all extensions that rely on a
forced update use the `!` form.
Should be much fast then.
fixes#1908
A buffer name wich special characters such as Command-T [Files] will
cause E94 when trying to call setbufvar() on it. That is because the
'[]' is special in buffer names. Therefore, fnameescape the buffer name.
This should prevent 'E94: No matching buffer for
/home/louis/git/minivimrc/Command-T [Files]' errors.
closes#1906
as requested by the exception thrown:
fugitive: A third-party plugin or vimrc is calling
fugitive#buffer().commit() which has been removed. Replace it with
matchstr(FugitiveParse()[0], '^\x\+')
if the same highlighting group is used on the left and right for the
label, the `airline_tablabel_to_airline_tabmod` will be overwritten on
the right side, causing the fg/bg colors to be wrong, because on the
right side they have to be the opposite of the left side.
So use a separate highlighting group for the tablabel on the right.
closes#1902