Problem with highlighting groups per tabpages

The current mode is only cached per window. This will break, if one
switches tabpage. We remember the last mode that was used to create the
highlighting group and compare, if this has changed.

This fixes #670
This commit is contained in:
Christian Brabandt 2016-02-06 23:00:02 +01:00
parent cb30971901
commit ac86003ac3
1 changed files with 3 additions and 1 deletions

View File

@ -179,10 +179,12 @@ function! airline#check_mode(winnr)
endif
let mode_string = join(l:mode)
if get(w:, 'airline_lastmode', '') != mode_string
if get(w:, 'airline_lastmode', '') != mode_string ||
\ get(s:, 'airline_lastmode', []) != l:mode
call airline#highlighter#highlight_modified_inactive(context.bufnr)
call airline#highlighter#highlight(l:mode)
let w:airline_lastmode = mode_string
let s:airline_lastmode = l:mode
endif
return ''