mirror of
https://github.com/airblade/vim-gitgutter.git
synced 2025-11-08 11:33:48 -05:00
@@ -64,6 +64,9 @@ function! gitgutter#hunk#next_hunk(count) abort
|
||||
if g:gitgutter_show_msg_on_hunk_jumping
|
||||
redraw | echo printf('Hunk %d of %d', index(hunks, hunk) + 1, len(hunks))
|
||||
endif
|
||||
if s:is_preview_window_open()
|
||||
call gitgutter#hunk#preview()
|
||||
endif
|
||||
return
|
||||
endif
|
||||
endif
|
||||
@@ -92,6 +95,9 @@ function! gitgutter#hunk#prev_hunk(count) abort
|
||||
if g:gitgutter_show_msg_on_hunk_jumping
|
||||
redraw | echo printf('Hunk %d of %d', index(hunks, hunk) + 1, len(hunks))
|
||||
endif
|
||||
if s:is_preview_window_open()
|
||||
call gitgutter#hunk#preview()
|
||||
endif
|
||||
return
|
||||
endif
|
||||
endif
|
||||
@@ -593,3 +599,14 @@ function! s:close_hunk_preview_window()
|
||||
let s:winid = 0
|
||||
let s:preview_bufnr = 0
|
||||
endfunction
|
||||
|
||||
|
||||
" Only makes sense for traditional, non-floating preview window.
|
||||
function s:is_preview_window_open()
|
||||
for i in range(1, winnr('$'))
|
||||
if getwinvar(i, '&previewwindow') == 1
|
||||
return 1
|
||||
endif
|
||||
endfor
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
Reference in New Issue
Block a user