File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,9 @@ function! gitgutter#hunk#next_hunk(count) abort
64
64
if g: gitgutter_show_msg_on_hunk_jumping
65
65
redraw | echo printf (' Hunk %d of %d' , index (hunks, hunk) + 1 , len (hunks))
66
66
endif
67
+ if s: is_preview_window_open ()
68
+ call gitgutter#hunk#preview ()
69
+ endif
67
70
return
68
71
endif
69
72
endif
@@ -92,6 +95,9 @@ function! gitgutter#hunk#prev_hunk(count) abort
92
95
if g: gitgutter_show_msg_on_hunk_jumping
93
96
redraw | echo printf (' Hunk %d of %d' , index (hunks, hunk) + 1 , len (hunks))
94
97
endif
98
+ if s: is_preview_window_open ()
99
+ call gitgutter#hunk#preview ()
100
+ endif
95
101
return
96
102
endif
97
103
endif
@@ -593,3 +599,14 @@ function! s:close_hunk_preview_window()
593
599
let s: winid = 0
594
600
let s: preview_bufnr = 0
595
601
endfunction
602
+
603
+
604
+ " Only makes sense for traditional, non-floating preview window.
605
+ function s: is_preview_window_open ()
606
+ for i in range (1 , winnr (' $' ))
607
+ if getwinvar (i , ' &previewwindow' ) == 1
608
+ return 1
609
+ endif
610
+ endfor
611
+ return 0
612
+ endfunction
You can’t perform that action at this time.
0 commit comments