From c2651aefbd92dca05de1943619df965b848f9b4f Mon Sep 17 00:00:00 2001 From: Andy Stewart Date: Mon, 26 Nov 2018 16:46:51 +0000 Subject: [PATCH] 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: https://github.com/airblade/vim-gitgutter/commit/af1e674155ac4f04db42c7d07ff5c85fd4bb6129#commitcomment-31431773 --- autoload/gitgutter/utility.vim | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/autoload/gitgutter/utility.vim b/autoload/gitgutter/utility.vim index c58afe0..6486fa4 100644 --- a/autoload/gitgutter/utility.vim +++ b/autoload/gitgutter/utility.vim @@ -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