From 218e4e5787afcdca8b411978ff1f4685977bd7d9 Mon Sep 17 00:00:00 2001 From: Yasuhiro Matsumoto Date: Sun, 13 Jan 2019 20:47:36 +0900 Subject: [PATCH] Fixes vint errors --- autoload/lsp/utils/diff.vim | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/autoload/lsp/utils/diff.vim b/autoload/lsp/utils/diff.vim index 9e4d50fb..aef00db3 100644 --- a/autoload/lsp/utils/diff.vim +++ b/autoload/lsp/utils/diff.vim @@ -9,7 +9,7 @@ function! lsp#utils#diff#compute(old, new) abort let [l:start_line, l:start_char] = s:FirstDifference(a:old, a:new) let [l:end_line, l:end_char] = - \ s:LastDifference(a:old[l:start_line:], a:new[l:start_line:], l:start_char) + \ s:LastDifference(a:old[l:start_line :], a:new[l:start_line :], l:start_char) let l:text = s:ExtractText(a:new, l:start_line, l:start_char, l:end_line, l:end_char) 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 let l:length = min([strlen(l:old_line), strlen(l:new_line)]) let l:j = 0 while l:j < l:length - if l:old_line[l:j:l:j] !=# l:new_line[l:j:l:j] | break | endif + if l:old_line[l:j : l:j] !=# l:new_line[l:j : l:j] | break | endif let l:j += 1 endwhile return [l:i, l:j] @@ -59,8 +59,8 @@ function! s:LastDifference(old, new, start_char) abort endwhile if l:i <= -1 * l:line_count let l:i = -1 * l:line_count - let l:old_line = a:old[l:i][a:start_char:] - let l:new_line = a:new[l:i][a:start_char:] + let l:old_line = a:old[l:i][a:start_char :] + let l:new_line = a:new[l:i][a:start_char :] else let l:old_line = a:old[l:i] let l:new_line = a:new[l:i] @@ -68,7 +68,7 @@ function! s:LastDifference(old, new, start_char) abort let l:length = min([strlen(l:old_line), strlen(l:new_line)]) let l:j = -1 while l:j >= -1 * l:length - if l:old_line[l:j:l:j] !=# l:new_line[l:j:l:j] | break | endif + if l:old_line[l:j : l:j] !=# l:new_line[l:j : l:j] | break | endif let l:j -= 1 endwhile return [l:i, l:j] @@ -77,12 +77,12 @@ endfunction function! s:ExtractText(lines, start_line, start_char, end_line, end_char) abort if a:start_line == len(a:lines) + a:end_line if a:end_line == 0 | return '' | endif - let l:result = a:lines[a:start_line][a:start_char:a:end_char] + let l:result = a:lines[a:start_line][a:start_char : a:end_char] " json_encode treats empty string computed this was as 'null' if strlen(l:result) == 0 | let l:result = '' | endif return l:result endif - let l:result = a:lines[a:start_line][a:start_char:]."\n" + let l:result = a:lines[a:start_line][a:start_char :]."\n" let l:adj_end_line = len(a:lines) + a:end_line for l:line in a:lines[a:start_line + 1:a:end_line - 1] let l:result .= l:line."\n"