add proper jump handling

This commit is contained in:
Marco Hinz 2013-03-06 12:19:38 +01:00
parent a7d9b85ae2
commit 2f615f3067

View File

@ -6,6 +6,7 @@ let g:loaded_signify = 1
" Default values {{{1 " Default values {{{1
let s:line_highlight_b = 0 let s:line_highlight_b = 0
let s:colors_set_b = 0 let s:colors_set_b = 0
let s:last_jump_was_next = -1
let s:active_buffers = {} let s:active_buffers = {}
let s:id_start = 0x100 let s:id_start = 0x100
@ -208,12 +209,20 @@ endfunction
" Functions -> s:jump_to_next_change() {{{2 " Functions -> s:jump_to_next_change() {{{2
function! s:jump_to_next_change() function! s:jump_to_next_change()
if s:last_jump_was_next == 0
let s:id_jump += 2
endif
exe 'sign jump '. s:id_jump .' file='. expand('%:p') exe 'sign jump '. s:id_jump .' file='. expand('%:p')
let s:id_jump = ((s:id_jump + 1) == s:id_top) ? (s:id_start) : (s:id_jump + 1) let s:id_jump = (s:id_jump == (s:id_top - 1)) ? (s:id_start) : (s:id_jump + 1)
let s:last_jump_was_next = 1
endfunction endfunction
" Functions -> s:jump_to_prev_change() {{{2 " Functions -> s:jump_to_prev_change() {{{2
function! s:jump_to_prev_change() function! s:jump_to_prev_change()
if s:last_jump_was_next == 1
let s:id_jump -= 2
endif
exe 'sign jump '. s:id_jump .' file='. expand('%:p') exe 'sign jump '. s:id_jump .' file='. expand('%:p')
let s:id_jump = (s:id_jump == s:id_start) ? (s:id_top - 1) : (s:id_jump - 1) let s:id_jump = (s:id_jump == s:id_start) ? (s:id_top - 1) : (s:id_jump - 1)
let s:last_jump_was_next = 0
endfunction endfunction