Work around older Vims not accepting arguments for function().

Fixes #618.
This commit is contained in:
Andy Stewart
2019-05-31 07:17:36 +01:00
parent 6affbc96f1
commit a7650790ea
2 changed files with 12 additions and 3 deletions

View File

@@ -27,7 +27,12 @@ function! gitgutter#process_buffer(bufnr, force) abort
call s:setup_maps(a:bufnr)
let how = s:setup_path(a:bufnr, function('gitgutter#process_buffer', [a:bufnr, a:force]))
if has('patch-7.4.1559')
let l:Callback = function('gitgutter#process_buffer', [a:bufnr, a:force])
else
let l:Callback = {'function': 'gitgutter#process_buffer', 'arguments': [a:bufnr, a:force]}
endif
let how = s:setup_path(a:bufnr, l:Callback)
if [how] == ['async'] " avoid string-to-number conversion if how is a number
return
endif