From ac86003ac3815d9efd76b02c4cdac91bee1c9588 Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Sat, 6 Feb 2016 23:00:02 +0100 Subject: [PATCH] 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 --- autoload/airline.vim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/autoload/airline.vim b/autoload/airline.vim index 83b7dfa2..fc323f4d 100644 --- a/autoload/airline.vim +++ b/autoload/airline.vim @@ -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 ''