summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerko Steiner <jerko.steiner@gmail.com>2019-12-29 15:08:22 +0100
committerJerko Steiner <jerko.steiner@gmail.com>2019-12-29 15:08:22 +0100
commit493705336c06e47df70c194c4aabb2a927e36d81 (patch)
treef60a507168bf3d20329380c3542304c14170cb4e
parent463deedc2998ecf864bb479f07e87aa4e83e3030 (diff)
downloadale-493705336c06e47df70c194c4aabb2a927e36d81.zip
Add old check for bufline api
-rw-r--r--autoload/ale/fix.vim2
-rw-r--r--autoload/ale/util.vim6
2 files changed, 6 insertions, 2 deletions
diff --git a/autoload/ale/fix.vim b/autoload/ale/fix.vim
index d2c1cb98..69817b36 100644
--- a/autoload/ale/fix.vim
+++ b/autoload/ale/fix.vim
@@ -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
diff --git a/autoload/ale/util.vim b/autoload/ale/util.vim
index b781971c..b7594167 100644
--- a/autoload/ale/util.vim
+++ b/autoload/ale/util.vim
@@ -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