Calculate correct ChangeDelete sign to use

Using deleted was causing the sign to reflect all the deleted lines so
far in the buffer instead of the deleted line count for this hunk.
This commit is contained in:
James McCoy 2013-09-27 00:13:28 -04:00
parent fb2f2405e6
commit ded8213bf6

View File

@ -236,14 +236,15 @@ function! sy#repo#process_diff(path, diff) abort
if old_count > new_count
let modified += new_count
let deleted += (old_count - new_count)
let removed = (old_count - new_count)
let deleted += removed
let offset = 0
while offset < (new_count - 1)
call add(signs, { 'type': 'SignifyChange', 'lnum': new_line + offset, 'path': a:path })
let offset += 1
endwhile
call add(signs, { 'type': (deleted > 9) ? 'SignifyChangeDeleteMore' : 'SignifyChangeDelete'. deleted, 'lnum': new_line, 'path': a:path })
call add(signs, { 'type': (removed > 9) ? 'SignifyChangeDeleteMore' : 'SignifyChangeDelete'. deleted, 'lnum': new_line, 'path': a:path })
" lines changed and added: