This commit is contained in:
Yasuhiro Matsumoto
2019-09-20 18:14:07 +09:00
parent 780e7538a4
commit a20a0c1da8

View File

@@ -527,6 +527,30 @@ Describe lsp#utils#text_edit
" Make sure v:completed_item is not changed
Assert Equals(v:completed_item, l:old_completed_item)
End
It replaces entire buffer correctly when end column is 1
call s:set_text(['foo', 'b'])
call lsp#utils#text_edit#apply_text_edits(
\ expand('%'),
\ [{
\ 'range': {
\ 'start': {
\ 'line': 0,
\ 'character': 0
\ },
\ 'end': {
\ 'line': 1,
\ 'character': 1
\ }
\ },
\ 'newText': "x\ny\nz\n"
\ }])
let l:buffer_text = s:get_text()
Assert Equals(l:buffer_text, ['x', 'y', 'z', 'b', ''])
End
End
End