add hunk case: lines were changed && deleted

This commit is contained in:
Marco Hinz 2013-03-07 07:50:14 +01:00
parent a92a3b67dd
commit 0eb42b7bb5

View File

@ -266,12 +266,22 @@ function! s:process_diff(diff) abort
exe 'sign place '. s:id_top .' line='. new_line .' name=SignifyDelete file='. l:path
let s:id_top += 1
" A line was changed.
else
elseif (old_count == new_count)
let offset = 0
while offset < new_count
exe 'sign place '. s:id_top .' line='. (new_line + offset) .' name=SignifyChange file='. l:path
let [ offset, s:id_top ] += [ 1, 1 ]
endwhile
else
" Lines were changed and deleted.
if (old_count > new_count)
let offset = 0
while offset < new_count
exe 'sign place '. s:id_top .' line='. (new_line + offset) .' name=SignifyChange file='. l:path
let [ offset, s:id_top ] += [ 1, 1 ]
endwhile
exe 'sign place '. s:id_top .' line='. (new_line + offset - 1) .' name=SignifyDelete file='. l:path
endif
endif
endfor
endfunction