diff options
author | Jacques Kvam <jwkvam@gmail.com> | 2019-05-27 20:12:24 -0700 |
---|---|---|
committer | Jacques Kvam <jwkvam@gmail.com> | 2019-05-27 20:12:24 -0700 |
commit | 47ad24c2219f86664e880f66342a2ffd0deefaa6 (patch) | |
tree | b460e1903032b88c4586f93c0e87347def795f82 | |
parent | bb08b81bf719d4c55669c583c65fbe4bbd795501 (diff) | |
download | ale-47ad24c2219f86664e880f66342a2ffd0deefaa6.zip |
fix neovim missing setbufline
-rw-r--r-- | autoload/ale/fix.vim | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/autoload/ale/fix.vim b/autoload/ale/fix.vim index 68b70d6a..2b9555bf 100644 --- a/autoload/ale/fix.vim +++ b/autoload/ale/fix.vim @@ -4,8 +4,9 @@ call ale#Set('fix_on_save_ignore', {}) " Vim doesn't let you modify hidden buffers. function! ale#fix#ApplyQueuedFixes(buffer) abort let l:data = get(g:ale_fix_buffer_data, a:buffer, {'done': 0}) + let l:has_bufline_api = exists('*deletebufline') && exists('*setbufline') - if !l:data.done || (!exists('*deletebufline') && a:buffer isnot bufnr('')) + if !l:data.done || (!l:has_bufline_api && a:buffer isnot bufnr('')) return endif @@ -21,7 +22,7 @@ function! ale#fix#ApplyQueuedFixes(buffer) abort let l:first_line_to_remove = len(l:new_lines) + 1 " Use a Vim API for setting lines in other buffers, if available. - if exists('*deletebufline') + if l:has_bufline_api call setbufline(a:buffer, 1, l:new_lines) call deletebufline(a:buffer, l:first_line_to_remove, '$') " Fall back on setting lines the old way, for the current buffer. |