mirror of
https://github.com/vim-airline/vim-airline.git
synced 2024-11-29 20:23:39 +08:00
wordcount: Word count for the combined file types
[Pandoc flavoured Markdown](https://en.wikipedia.org/wiki/Markdown#CommonMark) has its [own file type in `vim`](https://github.com/vim-pandoc/vim-pandoc-syntax#standalone), namely `markdown.pandoc`. Word count by default in `vim-airline` obviously would make a lot of sense for this popular file type. Fix this, by making sure that the wordcount extensions will apply correctly if any of the combined filetypes (e.g. either pandoc or markdwon) matches the list of allowed filetypes.
This commit is contained in:
parent
71a7e23f32
commit
3b339fee98
|
@ -93,10 +93,12 @@ function! airline#extensions#wordcount#apply(...)
|
|||
|
||||
" Check if filetype needs testing
|
||||
if did_filetype()
|
||||
" correctly test for compound filetypes (e.g. markdown.pandoc)
|
||||
let ft = substitute(&filetype, '\.', '\\|', 'g')
|
||||
|
||||
" Select test based on type of "filetypes": new=list, old=string
|
||||
if type(filetypes) == get(v:, 't_list', type([]))
|
||||
\ ? index(filetypes, &filetype) > -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user