From fa11b8855b152d70ced882743d701ea7420358be Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Tue, 20 Nov 2018 15:28:29 +0100 Subject: [PATCH] Test for TerminalOpen Autocommand before using it --- plugin/airline.vim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugin/airline.vim b/plugin/airline.vim index c620c7f3..418e8a14 100644 --- a/plugin/airline.vim +++ b/plugin/airline.vim @@ -128,7 +128,9 @@ function! s:airline_toggle() autocmd FocusGained * unlet! w:airline_lastmode | :call 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]