use wordcount function if available
This commit is contained in:
parent
048b24a916
commit
17f5eaaa6a
@ -9,11 +9,13 @@ function! s:update()
|
|||||||
if &ft !~ s:filetypes
|
if &ft !~ s:filetypes
|
||||||
unlet! b:airline_wordcount
|
unlet! b:airline_wordcount
|
||||||
return
|
return
|
||||||
|
elseif exists("*wordcount")
|
||||||
|
let b:airline_wordcount = printf(s:format, wordcount()['words']).
|
||||||
|
\ g:airline_symbols.space . g:airline_right_alt_sep . g:airline_symbols.space
|
||||||
elseif mode() =~? 's'
|
elseif mode() =~? 's'
|
||||||
" Bail on select mode
|
" Bail on select mode
|
||||||
return
|
return
|
||||||
endif
|
else
|
||||||
|
|
||||||
let old_status = v:statusmsg
|
let old_status = v:statusmsg
|
||||||
let position = getpos(".")
|
let position = getpos(".")
|
||||||
exe "silent normal! g\<c-g>"
|
exe "silent normal! g\<c-g>"
|
||||||
@ -29,6 +31,7 @@ function! s:update()
|
|||||||
else
|
else
|
||||||
unlet! b:airline_wordcount
|
unlet! b:airline_wordcount
|
||||||
endif
|
endif
|
||||||
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! airline#extensions#wordcount#apply(...)
|
function! airline#extensions#wordcount#apply(...)
|
||||||
|
Loading…
Reference in New Issue
Block a user