add hunk case: lines were changed && deleted
This commit is contained in:
parent
a92a3b67dd
commit
0eb42b7bb5
@ -266,12 +266,22 @@ function! s:process_diff(diff) abort
|
|||||||
exe 'sign place '. s:id_top .' line='. new_line .' name=SignifyDelete file='. l:path
|
exe 'sign place '. s:id_top .' line='. new_line .' name=SignifyDelete file='. l:path
|
||||||
let s:id_top += 1
|
let s:id_top += 1
|
||||||
" A line was changed.
|
" A line was changed.
|
||||||
else
|
elseif (old_count == new_count)
|
||||||
let offset = 0
|
let offset = 0
|
||||||
while offset < new_count
|
while offset < new_count
|
||||||
exe 'sign place '. s:id_top .' line='. (new_line + offset) .' name=SignifyChange file='. l:path
|
exe 'sign place '. s:id_top .' line='. (new_line + offset) .' name=SignifyChange file='. l:path
|
||||||
let [ offset, s:id_top ] += [ 1, 1 ]
|
let [ offset, s:id_top ] += [ 1, 1 ]
|
||||||
endwhile
|
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
|
endif
|
||||||
endfor
|
endfor
|
||||||
endfunction
|
endfunction
|
||||||
|
Loading…
x
Reference in New Issue
Block a user