From 91a277dd9295744ab9e78013dac0edac1352fb69 Mon Sep 17 00:00:00 2001 From: Marco Hinz Date: Tue, 2 Apr 2013 16:32:10 +0200 Subject: [PATCH] add s:jump_to_next_hunk() once again --- plugin/signify.vim | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/plugin/signify.vim b/plugin/signify.vim index ab7d30d..398af26 100644 --- a/plugin/signify.vim +++ b/plugin/signify.vim @@ -490,6 +490,29 @@ function! s:toggle_line_highlighting() abort call s:start(s:path) endfunction +" Function: s:jump_to_next_hunk {{{1 +function! s:jump_to_next_hunk(count) + if !has_key(s:sy, s:path) || s:sy[s:path].id_jump == -1 + echo 'signify: I cannot detect any changes!' + return + endif + + if s:sy[s:path].last_jump_was_next == 0 + let s:sy[s:path].id_jump += 2 + endif + + let s:sy[s:path].id_jump += a:count ? (a:count - 1) : 0 + + if s:sy[s:path].id_jump > s:sy[s:path].id_top + let s:sy[s:path].id_jump = s:sy[s:path].ids[0] + endif + + execute 'sign jump '. s:sy[s:path].id_jump .' file='. s:path + + let s:sy[s:path].id_jump += 1 + let s:sy[s:path].last_jump_was_next = 1 +endfunction + " Function: s:jump_to_prev_hunk {{{1 function! s:jump_to_prev_hunk(count) if !has_key(s:sy, s:path) || s:sy[s:path].id_jump == -1