From 8c32da38c7ffa944e83a03c87ec310fb8964c500 Mon Sep 17 00:00:00 2001 From: Stanislav Seletskiy Date: Thu, 5 Sep 2013 12:52:29 +0700 Subject: [PATCH] add tab modification detection --- autoload/airline/extensions/tabline.vim | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/autoload/airline/extensions/tabline.vim b/autoload/airline/extensions/tabline.vim index 7eab630..27de830 100644 --- a/autoload/airline/extensions/tabline.vim +++ b/autoload/airline/extensions/tabline.vim @@ -139,7 +139,18 @@ endfunction function! s:get_tabs() let b = airline#builder#new(s:builder_context) for i in range(1, tabpagenr('$')) - let group = i == tabpagenr() ? 'airline_tabsel' : 'airline_tab' + if i == tabpagenr() + let group = 'airline_tabsel' + if g:airline_detect_modified + for bi in tabpagebuflist(i) + if getbufvar(bi, '&modified') + let group = 'airline_tabmod' + endif + endfor + endif + else + let group = 'airline_tab' + endif let val = '%(' if s:tab_nr_type == 0 let val .= ' %{len(tabpagebuflist('.i.'))}'