branch: check existence of dirty key before accessing it

closes #1907
This commit is contained in:
Christian Brabandt 2019-04-30 16:33:05 +02:00
parent 28ed36a9ec
commit d1e82c71a3
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09
1 changed files with 3 additions and 1 deletions

View File

@ -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