improve setting of placeholder sign

This commit is contained in:
Marco Hinz 2013-04-14 16:23:25 +02:00
parent 7c687e7a3c
commit 95add7a181

View File

@ -150,12 +150,11 @@ function! s:start(path) abort
" Inactive buffer.. bail out. " Inactive buffer.. bail out.
elseif !s:sy[a:path].active elseif !s:sy[a:path].active
return return
" Update signs.
else else
execute 'sign place 99999 line=1 name=SignifyPlaceholder file='. a:path
call s:sign_remove_all(a:path)
let diff = s:repo_get_diff_{s:sy[a:path].type}(a:path) let diff = s:repo_get_diff_{s:sy[a:path].type}(a:path)
if empty(diff) if empty(diff)
sign unplace 99999 call s:sign_remove_all(a:path)
return return
endif endif
let s:sy[a:path].id_top = s:id_top let s:sy[a:path].id_top = s:id_top
@ -175,14 +174,16 @@ function! s:start(path) abort
call s:sign_get_others(a:path) call s:sign_get_others(a:path)
endif endif
execute 'sign place 99999 line=1 name=SignifyPlaceholder file='. a:path
call s:sign_remove_all(a:path)
call s:repo_process_diff(a:path, diff) call s:repo_process_diff(a:path, diff)
sign unplace 99999
if !maparg('[c', 'n') if !maparg('[c', 'n')
nnoremap <buffer><silent> ]c :<c-u>execute v:count .'SignifyJumpToNextHunk'<cr> nnoremap <buffer><silent> ]c :<c-u>execute v:count .'SignifyJumpToNextHunk'<cr>
nnoremap <buffer><silent> [c :<c-u>execute v:count .'SignifyJumpToPrevHunk'<cr> nnoremap <buffer><silent> [c :<c-u>execute v:count .'SignifyJumpToPrevHunk'<cr>
endif endif
sign unplace 99999
let s:sy[a:path].id_top = (s:id_top - 1) let s:sy[a:path].id_top = (s:id_top - 1)
endfunction endfunction
@ -236,7 +237,6 @@ function! s:sign_remove_all(path) abort
endfor endfor
let s:other_signs_line_numbers = {} let s:other_signs_line_numbers = {}
let s:sy[a:path].id_jump = -1
let s:sy[a:path].ids = [] let s:sy[a:path].ids = []
endfunction endfunction