From d1e82c71a31fb9ad3f8e516af01eefc90e766499 Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Tue, 30 Apr 2019 16:33:05 +0200 Subject: [PATCH] branch: check existence of dirty key before accessing it closes #1907 --- autoload/airline/extensions/branch.vim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/autoload/airline/extensions/branch.vim b/autoload/airline/extensions/branch.vim index 0b220ea2..23a0bdb8 100644 --- a/autoload/airline/extensions/branch.vim +++ b/autoload/airline/extensions/branch.vim @@ -239,7 +239,9 @@ function! airline#extensions#branch#head() endif let b:airline_head .= s:format_name({s:vcs_config[vcs].display_branch}()) let additional = b:buffer_vcs_config[vcs].untracked - if empty(additional) && b:buffer_vcs_config[vcs].dirty + if empty(additional) && + \ has_key(b:buffer_vcs_config[vcs], 'dirty') && + \ b:buffer_vcs_config[vcs].dirty let additional = g:airline_symbols['dirty'] endif let b:airline_head .= additional