mirror of
https://github.com/vim-airline/vim-airline.git
synced 2025-12-29 07:06:52 +08:00
wordcount: allow to disable vimtex wordcount()
While Commit e542f5e introduced a nice little feature for TeX files to
accurately count words, this unfortunately has the drawback of being
possibly slow, especially since the statusline is often re-evaluated.
Therefore disable this feature by default. You can enable it using:
:let g:airline#extensions#vimtex#wordcount = 1
fixes #2461
This commit is contained in:
@@ -9,8 +9,8 @@ if exists('*wordcount')
|
||||
if get(g:, 'actual_curbuf', '') != bufnr('')
|
||||
return
|
||||
endif
|
||||
if &filetype ==# 'tex' && exists('b:vimtex')
|
||||
" We're in a TeX file and vimtex is a plugin, so use vimtex's wordcount...
|
||||
if &filetype ==# 'tex' && exists('b:vimtex') && get(g:, 'airline#extensions#vimtex#wordcount', 0)
|
||||
" We're in a TeX file and vimtex is a plugin, so use vimtex's wordcount...
|
||||
return vimtex#misc#wordcount()
|
||||
else
|
||||
let query = a:visual_mode_active ? 'visual_words' : 'words'
|
||||
|
||||
Reference in New Issue
Block a user