From 7c318503815316b78f10803d6b38ca1679128b46 Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Tue, 14 Apr 2020 19:53:18 +0200 Subject: [PATCH] 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). --- autoload/airline/extensions/wordcount.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/airline/extensions/wordcount.vim b/autoload/airline/extensions/wordcount.vim index d8b00834..044416e4 100644 --- a/autoload/airline/extensions/wordcount.vim +++ b/autoload/airline/extensions/wordcount.vim @@ -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