Revert "Improves fixer performance for large buffers"
This commit is contained in:
parent
54dd731cf1
commit
49f8aa4703
1 changed files with 3 additions and 6 deletions
|
@ -486,7 +486,7 @@ function! ale#util#Input(message, value) abort
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale#util#HasBuflineApi() abort
|
function! ale#util#HasBuflineApi() abort
|
||||||
return exists('*deletebufline') && exists('*appendbufline') && exists('*getpos') && exists('*setpos')
|
return exists('*deletebufline') && exists('*setbufline')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Sets buffer contents to lines
|
" 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.
|
" Use a Vim API for setting lines in other buffers, if available.
|
||||||
if l:has_bufline_api
|
if l:has_bufline_api
|
||||||
let l:save_cursor = getpos('.')
|
call setbufline(a:buffer, 1, l:new_lines)
|
||||||
call deletebufline(a:buffer, 1, '$')
|
call deletebufline(a:buffer, l:first_line_to_remove, '$')
|
||||||
call appendbufline(a:buffer, 1, l:new_lines)
|
|
||||||
call deletebufline(a:buffer, 1, 1)
|
|
||||||
call setpos('.', l:save_cursor)
|
|
||||||
" Fall back on setting lines the old way, for the current buffer.
|
" Fall back on setting lines the old way, for the current buffer.
|
||||||
else
|
else
|
||||||
let l:old_line_length = line('$')
|
let l:old_line_length = line('$')
|
||||||
|
|
Reference in a new issue