SignifyDiffPreview: fix deleted line logic

References https://github.com/mhinz/vim-signify/issues/300
This commit is contained in:
Marco Hinz 2019-08-14 14:29:01 +02:00
parent 2b6824eb9f
commit 29d5f294a6
No known key found for this signature in database
GPG Key ID: 1C980A1B657B4A4F

View File

@ -324,14 +324,14 @@ endfunction
function! s:is_cur_line_in_hunk(hunkline) abort function! s:is_cur_line_in_hunk(hunkline) abort
let cur_line = line('.') let cur_line = line('.')
let [old_line, new_line, _old_count, new_count] = sy#sign#parse_hunk(a:hunkline) let [_old_line, new_line, old_count, new_count] = sy#sign#parse_hunk(a:hunkline)
if cur_line == 1 && new_line == 0 if cur_line == 1 && new_line == 0
" deleted first line " deleted first line
return 1 return 1
endif endif
if cur_line == new_line && new_line < old_line if cur_line == new_line && new_count < old_count
" deleted lines " deleted lines
return 1 return 1
endif endif