Test for TerminalOpen Autocommand before using it

This commit is contained in:
Christian Brabandt 2018-11-20 15:28:29 +01:00
parent 904ac4eb0b
commit fa11b8855b
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09

View File

@ -128,7 +128,9 @@ function! s:airline_toggle()
autocmd FocusGained * unlet! w:airline_lastmode | :call <sid>airline_refresh()
endif
autocmd TerminalOpen * :call airline#load_theme() " reload current theme for Terminal, forces the terminal extension to be loaded
if exists("##TerminalOpen")
autocmd TerminalOpen * :call airline#load_theme() " reload current theme for Terminal, forces the terminal extension to be loaded
endif
autocmd TabEnter * :unlet! w:airline_lastmode | let w:airline_active=1
autocmd BufWritePost */autoload/airline/themes/*.vim
\ exec 'source '.split(globpath(&rtp, 'autoload/airline/themes/'.g:airline_theme.'.vim', 1), "\n")[0]