wordcount: only test against complete filetypes

Put a word-boundary regex atom before and after the current filetype, to
make sure that a `C` filetype won't be detected as a filetype that
enables the wordcount extension. (`c` matches asciidoc).
This commit is contained in:
Christian Brabandt 2020-04-14 19:53:18 +02:00
parent 12aa326dae
commit 7c31850381
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09

View File

@ -98,7 +98,7 @@ function! airline#extensions#wordcount#apply(...)
" Select test based on type of "filetypes": new=list, old=string
if type(filetypes) == get(v:, 't_list', type([]))
\ ? match(filetypes, ft) > -1 || index(filetypes, 'all') > -1
\ ? match(filetypes, '\<'. ft. '\>') > -1 || index(filetypes, 'all') > -1
\ : match(&filetype, filetypes) > -1
let b:airline_changedtick = -1
call s:update_wordcount(1) " force update: ensures initial worcount exists