Bypass sticky type checking on older Vims

Until Vim 7.5.1546 the type of a variable could not be changed.

Fixes #693.
This commit is contained in:
Andy Stewart
2020-04-14 15:42:07 +01:00
parent b7db78b258
commit 5f6048da13

View File

@@ -11,6 +11,7 @@ function! gitgutter#utility#setbufvar(buffer, varname, val)
" Default value for getbufvar() was introduced in Vim 7.3.831.
let ggvars = getbufvar(buffer, 'gitgutter')
if type(ggvars) == type('')
unlet ggvars
let ggvars = {}
call setbufvar(buffer, 'gitgutter', ggvars)
endif