From 985f3d3ecada29a037cac87299c61a0a5f71fe31 Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Sun, 22 May 2016 21:29:00 +0200 Subject: [PATCH] b:airline_head sometimes undefined Make sure, b:airline_head variable is set, also it is initially set in this function earlier. But see #1171 for an error. Therefore, before checking if the variable is empty, make sure it exists. fixes #1171 --- autoload/airline/extensions/branch.vim | 1 + 1 file changed, 1 insertion(+) diff --git a/autoload/airline/extensions/branch.vim b/autoload/airline/extensions/branch.vim index 2157547d..422a65ce 100644 --- a/autoload/airline/extensions/branch.vim +++ b/autoload/airline/extensions/branch.vim @@ -141,6 +141,7 @@ function! airline#extensions#branch#head() endif endif else + let b:airline_head = get(b:, 'airline_head', '') for vcs in l:vcs_priority if has_key(l:heads, vcs) if !empty(b:airline_head)