File tree 1 file changed +6
-7
lines changed
1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -1741,15 +1741,14 @@ function s:applyTextEdits(bufnr, msg) abort
1741
1741
continue
1742
1742
endif
1743
1743
1744
- let l: startcontent = getline (l: startline )
1745
- let l: preSliceEnd = 0
1744
+ " Assume that l:startcontent will be an empty string. When the replacement
1745
+ " is not at the beginning of the line, then l:startcontent must be what
1746
+ " comes before the start position on the start line.
1747
+ let l: startcontent = ' '
1746
1748
if l: msg .range .start .character > 0
1749
+ let l: startcontent = getline (l: startline )
1747
1750
let l: preSliceEnd = go#lsp#lsp#PositionOf (l: startcontent , l: msg .range .start .character - 1 ) - 1
1748
1751
let l: startcontent = l: startcontent [:l: preSliceEnd ]
1749
- elseif l: endline == l: startline && (l: msg .range .end .character == 0 || l: msg .range .start .character == 0 )
1750
- " l:startcontent should be the empty string when l:text is a
1751
- " replacement at the beginning of the line.
1752
- let l: startcontent = ' '
1753
1752
endif
1754
1753
1755
1754
let l: endcontent = getline (l: endline )
@@ -1820,7 +1819,7 @@ function! s:textEditLess(left, right) abort
1820
1819
endif
1821
1820
endif
1822
1821
1823
- " return 0, because a:left an a:right refer to the same position.
1822
+ " return 0, because a:left and a:right refer to the same position.
1824
1823
return 0
1825
1824
endfunction
1826
1825
You can’t perform that action at this time.
0 commit comments