tabline: Vim9 script implementation of #init function

This commit is contained in:
Christian 2020-11-18 15:24:04 +01:00 committed by Christian Brabandt
parent e81d400b09
commit 19f8be42b6
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09

View File

@ -11,7 +11,6 @@ endif
let s:ctrlspace = get(g:, 'CtrlSpaceLoaded', 0)
let s:tabws = get(g:, 'tabws_loaded', 0)
unlet! g:airline_experimental
if !exists(":def") || (exists(":def") && get(g:, "airline_experimental", 0)==0)
" Legacy VimScript implementation " {{{1
@ -254,4 +253,13 @@ if !exists(":def") || (exists(":def") && get(g:, "airline_experimental", 0)==0)
endfunction
else
" Vim9 Script implementation
def airline#extensions#tabline#init(ext: dict<any>): void # {{{2
if has('gui_running') && match(&guioptions, 'e') > -1
:set guioptions-=e
endif
autocmd User AirlineToggledOn s:toggle_on()
autocmd User AirlineToggledOff s:toggle_off()
s:toggle_on()
a:ext.add_theme_func('airline#extensions#tabline#load_theme')
enddef
endif