Previously it used a width of >= 80 to display the long word count
format. However I personally found that a bit too wide, while other
sections will be shortened too much which does not really look nice.
Therefore, adjust the limit a bit, using the short word count format for
windows up to 85 characters.
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
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
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