@@ -404,11 +404,11 @@ let s:file_content = {}
404404function ! s: text_changes (buf ) abort
405405 if has_key (s: file_content , a: buf )
406406 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 , ' $' )
408408 let l: changes = lsp#utils#diff#compute (l: old_content , l: new_content )
409409 let s: file_content [a: buf ] = l: new_content
410410 else
411- let l: new_content = getline ( 1 , ' $' )
411+ let l: new_content = getbufline ( a: buf , 1 , ' $' )
412412 let l: changes = {' text' : l: new_content }
413413 let s: file_content [a: buf ] = l: new_content
414414 endif
@@ -434,8 +434,6 @@ function! s:ensure_changed(buf, server_name, cb) abort
434434 let l: buffer_info [' changed_tick' ] = l: changed_tick
435435 let l: buffer_info [' version' ] = l: buffer_info [' version' ] + 1
436436
437- " todo: support range in contentChanges
438-
439437 call s: send_notification (a: server_name , {
440438 \ ' method' : ' textDocument/didChange' ,
441439 \ ' params' : {
@@ -621,9 +619,7 @@ function! s:requires_eol_at_eof(buf) abort
621619endfunction
622620
623621function ! 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 " )
627623endfunction
628624
629625function ! s: get_text_document (buf , buffer_info) abort
0 commit comments