Skip to content

Commit

Permalink
Enable is_preview_window_open() to handle floating windows
Browse files Browse the repository at this point in the history
  • Loading branch information
airblade committed Jun 2, 2021
1 parent 5b4ec87 commit 2571c8f
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions autoload/gitgutter/hunk.vim
Original file line number Diff line number Diff line change
Expand Up @@ -601,12 +601,17 @@ function! gitgutter#hunk#close_hunk_preview_window()
endfunction


" Only makes sense for traditional, non-floating preview window.
function gitgutter#hunk#is_preview_window_open()
for i in range(1, winnr('$'))
if getwinvar(i, '&previewwindow')
return 1
if g:gitgutter_preview_win_floating
if win_id2win(s:winid) > 0
execute win_id2win(s:winid).'wincmd c'
endif
endfor
else
for i in range(1, winnr('$'))
if getwinvar(i, '&previewwindow')
return 1
endif
endfor
endif
return 0
endfunction

0 comments on commit 2571c8f

Please sign in to comment.