Move strchars into util.vim

This commit is contained in:
mrmr1993
2018-03-19 14:58:50 +00:00
parent 5b7b9cf656
commit 51bb8dd7e0
2 changed files with 16 additions and 16 deletions

View File

@@ -86,3 +86,13 @@ else
return 0
endfunction
endif
" Compatibility wrapper for strchars, in case this vim version does not
" have it natively
function! airline#util#strchars(str)
if exists('*strchars')
return strchars(a:str)
else
return strlen(substitute(a:str, '.', 'a', 'g'))
endif
endfunction