Do not update wordcount on unknown buffers

This commit is contained in:
Christian Brabandt 2017-02-26 10:25:21 +01:00
parent 727a2b48d9
commit 9d89375b8f
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09

View File

@ -8,6 +8,9 @@ let g:airline#extensions#wordcount#filetypes = get(g:, 'airline#extensions#wordc
\ '\vhelp|markdown|rst|org|text|asciidoc|tex|mail') \ '\vhelp|markdown|rst|org|text|asciidoc|tex|mail')
function! s:wordcount_update() function! s:wordcount_update()
if empty(bufname(''))
return
endif
if match(&ft, get(g:, 'airline#extensions#wordcount#filetypes')) > -1 if match(&ft, get(g:, 'airline#extensions#wordcount#filetypes')) > -1
let l:mode = mode() let l:mode = mode()
if l:mode ==# 'v' || l:mode ==# 'V' || l:mode ==# 's' || l:mode ==# 'S' if l:mode ==# 'v' || l:mode ==# 'V' || l:mode ==# 's' || l:mode ==# 'S'