Merge pull request #921 from chrisbra/doc-wordcount

use wordcount function if available
This commit is contained in:
Christian Brabandt 2016-01-16 12:56:51 +01:00
commit 8845f56686
1 changed files with 18 additions and 15 deletions

View File

@ -9,11 +9,13 @@ function! s:update()
if &ft !~ s:filetypes
unlet! b:airline_wordcount
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'
" Bail on select mode
return
endif
else
let old_status = v:statusmsg
let position = getpos(".")
exe "silent normal! g\<c-g>"
@ -29,6 +31,7 @@ function! s:update()
else
unlet! b:airline_wordcount
endif
endif
endfunction
function! airline#extensions#wordcount#apply(...)