Skip to content

Commit

Permalink
Fix closing floating preview window
Browse files Browse the repository at this point in the history
When a floating window is closed, the cursor automatically goes back to
the original window.  There is no need to try to do this ourselves.

Fixes airblade#866.
  • Loading branch information
airblade committed Aug 17, 2023
1 parent 68f16eb commit a7a83c3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion autoload/gitgutter/hunk.vim
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,9 @@ function! s:hunk_op(op, ...)

let hunk_diff = join(hunk_header + hunk_body, "\n")."\n"

call s:goto_original_window()
if &previewwindow
call s:goto_original_window()
endif
call gitgutter#hunk#close_hunk_preview_window()
call s:stage(hunk_diff)
endif
Expand Down

0 comments on commit a7a83c3

Please sign in to comment.