diff options
author | w0rp <w0rp@users.noreply.github.com> | 2021-01-14 20:41:55 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-14 20:41:55 +0000 |
commit | 6fbdec8587ad918dccf13546418904d3f2c38a46 (patch) | |
tree | e4bbf7f418ecb1dc9d5972ce3f864e9d42821da8 /autoload | |
parent | 8dce126a6c379a1f9043061cb4d4c7673a987c39 (diff) | |
parent | 49f8aa4703caea1fc792e372da99f296776872f8 (diff) | |
download | ale-6fbdec8587ad918dccf13546418904d3f2c38a46.zip |
Merge pull request #3535 from dense-analysis/revert-3358-master
Revert "Improves fixer performance for large buffers"
Diffstat (limited to 'autoload')
-rw-r--r-- | autoload/ale/util.vim | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/autoload/ale/util.vim b/autoload/ale/util.vim index fcc03eb7..1f396377 100644 --- a/autoload/ale/util.vim +++ b/autoload/ale/util.vim @@ -486,7 +486,7 @@ function! ale#util#Input(message, value) abort endfunction function! ale#util#HasBuflineApi() abort - return exists('*deletebufline') && exists('*appendbufline') && exists('*getpos') && exists('*setpos') + return exists('*deletebufline') && exists('*setbufline') endfunction " Sets buffer contents to lines @@ -507,11 +507,8 @@ function! ale#util#SetBufferContents(buffer, lines) abort " Use a Vim API for setting lines in other buffers, if available. if l:has_bufline_api - let l:save_cursor = getpos('.') - call deletebufline(a:buffer, 1, '$') - call appendbufline(a:buffer, 1, l:new_lines) - call deletebufline(a:buffer, 1, 1) - call setpos('.', l:save_cursor) + 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. else let l:old_line_length = line('$') |