From 48f762e3129af55799d0766a70e3912270a711b1 Mon Sep 17 00:00:00 2001 From: gstewart Date: Tue, 31 Dec 2013 17:38:16 -0800 Subject: [PATCH] Fixed modified tab/buffer not updating in tabline --- autoload/airline/extensions/tabline.vim | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/autoload/airline/extensions/tabline.vim b/autoload/airline/extensions/tabline.vim index cf3d7df2..0bad224f 100644 --- a/autoload/airline/extensions/tabline.vim +++ b/autoload/airline/extensions/tabline.vim @@ -183,10 +183,13 @@ endfunction let s:current_bufnr = -1 let s:current_tabnr = -1 let s:current_tabline = '' +let s:current_modified = 0 function! s:get_buffers() let cur = bufnr('%') if cur == s:current_bufnr - return s:current_tabline + if !g:airline_detect_modified || getbufvar(cur, '&modified') == s:current_modified + return s:current_tabline + endif endif let b = airline#builder#new(s:builder_context) @@ -202,6 +205,7 @@ function! s:get_buffers() else let group = 'airline_tabsel' endif + let s:current_modified = (group == 'airline_tabmod') ? 1 : 0 else if index(tab_bufs, nr) > -1 let group = 'airline_tab' @@ -225,7 +229,9 @@ function! s:get_tabs() let curbuf = bufnr('%') let curtab = tabpagenr() if curbuf == s:current_bufnr && curtab == s:current_tabnr - return s:current_tabline + if !g:airline_detect_modified || getbufvar(curbuf, '&modified') == s:current_modified + return s:current_tabline + endif endif let b = airline#builder#new(s:builder_context) @@ -239,6 +245,7 @@ function! s:get_tabs() endif endfor endif + let s:current_modified = (group == 'airline_tabmod') ? 1 : 0 else let group = 'airline_tab' endif