@@ -404,11 +404,11 @@ let s:file_content = {}
404
404
function ! s: text_changes (buf ) abort
405
405
if has_key (s: file_content , a: buf )
406
406
let l: old_content = get (s: file_content , a: buf , [])
407
- let l: new_content = getline ( 1 , ' $' )
407
+ let l: new_content = getbufline ( a: buf , 1 , ' $' )
408
408
let l: changes = lsp#utils#diff#compute (l: old_content , l: new_content )
409
409
let s: file_content [a: buf ] = l: new_content
410
410
else
411
- let l: new_content = getline ( 1 , ' $' )
411
+ let l: new_content = getbufline ( a: buf , 1 , ' $' )
412
412
let l: changes = {' text' : l: new_content }
413
413
let s: file_content [a: buf ] = l: new_content
414
414
endif
@@ -434,8 +434,6 @@ function! s:ensure_changed(buf, server_name, cb) abort
434
434
let l: buffer_info [' changed_tick' ] = l: changed_tick
435
435
let l: buffer_info [' version' ] = l: buffer_info [' version' ] + 1
436
436
437
- " todo: support range in contentChanges
438
-
439
437
call s: send_notification (a: server_name , {
440
438
\ ' method' : ' textDocument/didChange' ,
441
439
\ ' params' : {
@@ -621,9 +619,7 @@ function! s:requires_eol_at_eof(buf) abort
621
619
endfunction
622
620
623
621
function ! s: get_text_document_text (buf ) abort
624
- let l: buf_fileformat = getbufvar (a: buf , ' &fileformat' )
625
- let l: eol = {' unix' : " \n " , ' dos' : " \r \n " , ' mac' : " \r " }[l: buf_fileformat ]
626
- return join (getbufline (a: buf , 1 , ' $' ), l: eol ).(s: requires_eol_at_eof (a: buf ) ? l: eol : ' ' )
622
+ return join (getbufline (a: buf , 1 , ' $' ), " \n " )
627
623
endfunction
628
624
629
625
function ! s: get_text_document (buf , buffer_info) abort
0 commit comments