wordcount: skip updating wordcount for vimtex#misc#wordcount() in visual mode

closes #2624
This commit is contained in:
Christian Brabandt 2023-01-29 22:06:50 +01:00
parent c7460aa883
commit 18b85395d3
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09

View File

@ -11,7 +11,12 @@ if exists('*wordcount')
endif
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()
if a:visual_mode_active
" not useful?
return
else
return vimtex#misc#wordcount()
endif
else
let query = a:visual_mode_active ? 'visual_words' : 'words'
return get(wordcount(), query, 0)