mirror of
https://github.com/vim-airline/vim-airline.git
synced 2025-12-06 20:24:27 +08:00
branch: allow multibyte chars in shortening algorithm
previously, the branch extension used name[0:6], however that would break with multibyte characters, since this is a byte index and not a character index. fixes #1686
This commit is contained in:
@@ -113,7 +113,7 @@ function! s:display_git_branch()
|
|||||||
if ref !~ "^fatal: no tag exactly matches"
|
if ref !~ "^fatal: no tag exactly matches"
|
||||||
let name = s:format_name(substitute(ref, '\v\C^%(heads/|remotes/|tags/)=','',''))."(".name.")"
|
let name = s:format_name(substitute(ref, '\v\C^%(heads/|remotes/|tags/)=','',''))."(".name.")"
|
||||||
else
|
else
|
||||||
let name = commit[0:s:sha1size-1]."(".name.")"
|
let name = matchstr(commit, '.\{'.s:sha1size.'}')."(".name.")"
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
catch
|
catch
|
||||||
|
|||||||
Reference in New Issue
Block a user