mirror of
https://github.com/vim-airline/vim-airline.git
synced 2025-01-20 07:12:46 +08:00
3f82d3a975
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 |
||
---|---|---|
.. | ||
airline | ||
airline.vim |