denite: Check filetype in mode function

references #1540
This commit is contained in:
Christian Brabandt 2017-08-25 08:38:31 +02:00
parent 9bd2c40e7d
commit 5345c8fafa
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09
1 changed files with 8 additions and 5 deletions

View File

@ -11,11 +11,14 @@ endif
" that implements its own insert/normal mode so we have to handle changing the " that implements its own insert/normal mode so we have to handle changing the
" highlight " highlight
function! airline#extensions#denite#check_denite_mode(bufnr) function! airline#extensions#denite#check_denite_mode(bufnr)
let l:mode = split(denite#get_status_mode(), ' ') if &filetype != 'denite'
let l:mode = tolower(l:mode[1]) return ''
if !exists('b:denite_mode_cache') || l:mode != b:denite_mode_cache endif
call airline#highlighter#highlight([l:mode], a:bufnr) let mode = split(denite#get_status_mode(), ' ')
let b:denite_mode_cache = l:mode let mode = tolower(mode[1])
if !exists('b:denite_mode_cache') || mode != b:denite_mode_cache
call airline#highlighter#highlight([mode], a:bufnr)
let b:denite_mode_cache = mode
endif endif
return '' return ''
endfunction endfunction