Do not pass a default value to getbufvar().

That was introduced in Vim 7.3.831 but there are a few Vims older than
that still around.

See:
af1e674155 (commitcomment-31431773)
This commit is contained in:
Andy Stewart
2018-11-26 16:46:51 +00:00
parent 3f642a0bb8
commit c2651aefbd

View File

@@ -8,7 +8,12 @@ endfunction
function! gitgutter#utility#setbufvar(buffer, varname, val)
let buffer = +a:buffer
let dict = get(getbufvar(buffer, '', {}), 'gitgutter', {})
" Default value for getbufvar() was introduced in Vim 7.3.831.
let bvars = getbufvar(buffer, '')
if empty(bvars)
let bvars = {}
endif
let dict = get(bvars, 'gitgutter', {})
let needs_setting = empty(dict)
let dict[a:varname] = a:val
if needs_setting