tabline: Vim9 script implementation of group_of_bufnr

This commit is contained in:
Christian 2020-11-18 17:30:12 +01:00 committed by Christian Brabandt
parent a77cd28ecc
commit c8c30c9e3e
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09

View File

@ -431,4 +431,24 @@ else
}
return airline#extensions#tabline#builder#new(builder_context)
enddef
def airline#extensions#tabline#group_of_bufnr(tab_bufs: list<number>, bufnr: number): string # {{{2
let cur = bufnr('%')
var group = ''
if cur == bufnr
if g:airline_detect_modified && getbufvar(bufnr, '&modified')
group = 'airline_tabmod'
else
group = 'airline_tabsel'
endif
else
if g:airline_detect_modified && getbufvar(bufnr, '&modified')
group = 'airline_tabmod_unsel'
elseif index(tab_bufs, bufnr) > -1
group = 'airline_tab'
else
group = 'airline_tabhid'
endif
endif
return group
enddef
endif