From 6601474bf5c9e1c295dea9c1177361e6e9820e88 Mon Sep 17 00:00:00 2001 From: "Ming, Bai" Date: Tue, 22 Jan 2019 14:44:52 -0800 Subject: [PATCH] Fixed t:undotree undefined error the ```t:undotree.GetStatusLine()``` is appended to the status line when ```t:undotree``` exists, but it seems like the ```statusline``` will be executed when ```t:undtree``` is no longer available during window destruction. --- autoload/airline/extensions/undotree.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autoload/airline/extensions/undotree.vim b/autoload/airline/extensions/undotree.vim index 9e43dfb..4c42642 100644 --- a/autoload/airline/extensions/undotree.vim +++ b/autoload/airline/extensions/undotree.vim @@ -11,14 +11,14 @@ function! airline#extensions#undotree#apply(...) if exists('t:undotree') if &ft == 'undotree' if exists('*t:undotree.GetStatusLine') - call airline#extensions#apply_left_override('undo', '%{t:undotree.GetStatusLine()}') + call airline#extensions#apply_left_override('undo', '%{exists("t:undotree") ? t:undotree.GetStatusLine() : ""}') else call airline#extensions#apply_left_override('undotree', '%f') endif endif if &ft == 'diff' && exists('*t:diffpanel.GetStatusLine') - call airline#extensions#apply_left_override('diff', '%{t:diffpanel.GetStatusLine()}') + call airline#extensions#apply_left_override('diff', '%{exists("t:diffpanel") ? t:diffpanel.GetStatusLine() : ""}') endif endif endfunction