add hunk case: lines added && changed

This commit is contained in:
Marco Hinz 2013-03-07 07:59:06 +01:00
parent 0eb42b7bb5
commit 219b5ac052

View File

@ -273,7 +273,7 @@ function! s:process_diff(diff) abort
let [ offset, s:id_top ] += [ 1, 1 ]
endwhile
else
" Lines were changed and deleted.
" Lines were changed && deleted.
if (old_count > new_count)
let offset = 0
while offset < new_count
@ -281,6 +281,17 @@ function! s:process_diff(diff) abort
let [ offset, s:id_top ] += [ 1, 1 ]
endwhile
exe 'sign place '. s:id_top .' line='. (new_line + offset - 1) .' name=SignifyDelete file='. l:path
" (old_count < new_count): Lines were added && changed.
else
let offset = 0
while offset < old_count
exe 'sign place '. s:id_top .' line='. (new_line + offset) .' name=SignifyAdd file='. l:path
let offset += 1
endwhile
while offset < new_count
exe 'sign place '. s:id_top .' line='. (new_line + offset) .' name=SignifyChange file='. l:path
let offset += 1
endwhile
endif
endif
endfor