Skip to content

Commit a076247

Browse files
committed
cosmetic changes
1 parent 943e272 commit a076247

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

autoload/lsp.vim

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -404,11 +404,11 @@ let s:file_content = {}
404404
function! 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
621619
endfunction
622620

623621
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")
627623
endfunction
628624

629625
function! s:get_text_document(buf, buffer_info) abort

autoload/lsp/utils/diff.vim

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
" This is copied from https://github.com/natebosch/vim-lsc/blob/master/autoload/lsc/diff.vim
2+
"
13
" Computes a simplistic diff between [old] and [new].
24
"
35
" Returns a dict with keys `range`, `rangeLength`, and `text` matching the LSP

0 commit comments

Comments
 (0)