Support getbufvar for vim < v7.3.831

This commit is contained in:
Rane Brown 2019-07-20 22:13:48 -06:00
parent 3180209c6f
commit 0678df38e9

View File

@ -888,7 +888,8 @@ endfunction
function! vimwiki#vars#get_bufferlocal(key, ...) function! vimwiki#vars#get_bufferlocal(key, ...)
let buffer = a:0 ? a:1 : '%' let buffer = a:0 ? a:1 : '%'
let value = getbufvar(buffer, 'vimwiki_'.a:key, '/\/\') " 'get(getbufvar(...' handles vim < v7.3.831 that didn't allow a default value for getbufvar
let value = get(getbufvar(buffer, ''), 'vimwiki_'.a:key, '/\/\')
if type(value) != 1 || value !=# '/\/\' if type(value) != 1 || value !=# '/\/\'
return value return value
elseif a:key ==# 'wiki_nr' elseif a:key ==# 'wiki_nr'