99function ! lsp#utils#diff#compute (old, new ) abort
1010 let [l: start_line , l: start_char ] = s: FirstDifference (a: old , a: new )
1111 let [l: end_line , l: end_char ] =
12- \ s: LastDifference (a: old [l: start_line :], a: new [l: start_line :], l: start_char )
12+ \ s: LastDifference (a: old [l: start_line :], a: new [l: start_line :], l: start_char )
1313
1414 let l: text = s: ExtractText (a: new , l: start_line , l: start_char , l: end_line , l: end_char )
1515 let l: length = s: Length (a: old , l: start_line , l: start_char , l: end_line , l: end_char )
@@ -43,7 +43,7 @@ function! s:FirstDifference(old, new) abort
4343 let l: length = min ([strlen (l: old_line ), strlen (l: new_line )])
4444 let l: j = 0
4545 while l: j < l: length
46- if l: old_line [l: j: l: j ] !=# l: new_line [l: j: l: j ] | break | endif
46+ if l: old_line [l: j : l: j ] !=# l: new_line [l: j : l: j ] | break | endif
4747 let l: j += 1
4848 endwhile
4949 return [l: i , l: j ]
@@ -59,16 +59,16 @@ function! s:LastDifference(old, new, start_char) abort
5959 endwhile
6060 if l: i <= -1 * l: line_count
6161 let l: i = -1 * l: line_count
62- let l: old_line = a: old [l: i ][a: start_char :]
63- let l: new_line = a: new [l: i ][a: start_char :]
62+ let l: old_line = a: old [l: i ][a: start_char :]
63+ let l: new_line = a: new [l: i ][a: start_char :]
6464 else
6565 let l: old_line = a: old [l: i ]
6666 let l: new_line = a: new [l: i ]
6767 endif
6868 let l: length = min ([strlen (l: old_line ), strlen (l: new_line )])
6969 let l: j = -1
7070 while l: j >= -1 * l: length
71- if l: old_line [l: j: l: j ] !=# l: new_line [l: j: l: j ] | break | endif
71+ if l: old_line [l: j : l: j ] !=# l: new_line [l: j : l: j ] | break | endif
7272 let l: j -= 1
7373 endwhile
7474 return [l: i , l: j ]
@@ -77,12 +77,12 @@ endfunction
7777function ! s: ExtractText (lines , start_line, start_char, end_line, end_char) abort
7878 if a: start_line == len (a: lines ) + a: end_line
7979 if a: end_line == 0 | return ' ' | endif
80- let l: result = a: lines [a: start_line ][a: start_char: a: end_char ]
80+ let l: result = a: lines [a: start_line ][a: start_char : a: end_char ]
8181 " json_encode treats empty string computed this was as 'null'
8282 if strlen (l: result ) == 0 | let l: result = ' ' | endif
8383 return l: result
8484 endif
85- let l: result = a: lines [a: start_line ][a: start_char :]." \n "
85+ let l: result = a: lines [a: start_line ][a: start_char :]." \n "
8686 let l: adj_end_line = len (a: lines ) + a: end_line
8787 for l: line in a: lines [a: start_line + 1 :a: end_line - 1 ]
8888 let l: result .= l: line ." \n "
0 commit comments