Add old check for bufline api

This commit is contained in:
Jerko Steiner 2019-12-29 15:08:22 +01:00
parent 463deedc29
commit 493705336c
2 changed files with 6 additions and 2 deletions

View file

@ -5,7 +5,7 @@ call ale#Set('fix_on_save_ignore', {})
function! ale#fix#ApplyQueuedFixes(buffer) abort
let l:data = get(g:ale_fix_buffer_data, a:buffer, {'done': 0})
if !l:data.done
if !l:data.done || (!ale#util#HasBuflineApi() && a:buffer isnot bufnr(''))
return
endif

View file

@ -481,9 +481,13 @@ function! ale#util#Input(message, value) abort
return input(a:message, a:value)
endfunction
function! ale#util#HasBuflineApi() abort
return exists('*deletebufline') && exists('*setbufline')
endfunction
" Sets buffer contents to lines
function! ale#util#SetBufferContents(buffer, lines) abort
let l:has_bufline_api = exists('*deletebufline') && exists('*setbufline')
let l:has_bufline_api = ale#util#HasBuflineApi()
if !l:has_bufline_api && a:buffer isnot bufnr('')
return