Show message like "Hunk 4 of 11" after hunk jumping

This commit is contained in:
obcat
2020-11-02 01:44:35 +09:00
committed by Andy Stewart
parent 696a6ed389
commit 987a33355e
4 changed files with 22 additions and 0 deletions

View File

@@ -61,6 +61,9 @@ function! gitgutter#hunk#next_hunk(count) abort
let hunk_count += 1
if hunk_count == a:count
execute 'normal!' hunk[2] . 'Gzv'
if g:gitgutter_show_msg_on_hunk_jumping
redraw | echo printf('Hunk %d of %d', index(hunks, hunk) + 1, len(hunks))
endif
return
endif
endif
@@ -86,6 +89,9 @@ function! gitgutter#hunk#prev_hunk(count) abort
if hunk_count == a:count
let target = hunk[2] == 0 ? 1 : hunk[2]
execute 'normal!' target . 'Gzv'
if g:gitgutter_show_msg_on_hunk_jumping
redraw | echo printf('Hunk %d of %d', index(hunks, hunk) + 1, len(hunks))
endif
return
endif
endif