Skip to content
This repository was archived by the owner on Aug 24, 2020. It is now read-only.

Commit 3e207c0

Browse files
hrsh7thmattn
andauthored
Change text edit implementation to support \r (prabirshrestha#718)
* Change text edit implementation to support \r * Fix edit on unloaded buffer * Add \r\n tests * Fix for perf Co-authored-by: mattn <[email protected]>
1 parent a79931d commit 3e207c0

File tree

5 files changed

+194
-242
lines changed

5 files changed

+194
-242
lines changed

autoload/lsp/utils.vim

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,3 +319,8 @@ function! lsp#utils#make_valid_word(str) abort
319319
endif
320320
return l:str
321321
endfunction
322+
323+
function! lsp#utils#_split_by_eol(text) abort
324+
return split(a:text, '\r\n\|\r\|\n', v:true)
325+
endfunction
326+

autoload/lsp/utils/buffer.vim

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ function! s:get_fixendofline(buf) abort
2626
endif
2727
endfunction
2828

29+
function! lsp#utils#buffer#_get_fixendofline(bufnr) abort
30+
return s:get_fixendofline(a:bufnr)
31+
endfunction
32+
2933
function! lsp#utils#buffer#_get_lines(buf) abort
3034
let l:lines = getbufline(a:buf, 1, '$')
3135
if s:get_fixendofline(a:buf)

0 commit comments

Comments
 (0)