Skip to content

Commit

Permalink
Prevent 'previewpopup' from breaking hunk previews
Browse files Browse the repository at this point in the history
  • Loading branch information
airblade committed Feb 2, 2022
1 parent 384bf00 commit 54b94f9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions autoload/gitgutter/hunk.vim
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,8 @@ function! s:open_hunk_preview_window()
endif
endif

let [previewpopup, &previewpopup] = [&previewpopup, '']

" Specifying where to open the preview window can lead to the cursor going
" to an unexpected window when the preview window is closed (#769).
silent! noautocmd execute g:gitgutter_preview_win_location 'pedit gitgutter://hunk-preview'
Expand All @@ -484,6 +486,8 @@ function! s:open_hunk_preview_window()
" Ensure cursor goes to the expected window.
nnoremap <buffer> <silent> <Esc> :<C-U>wincmd p<Bar>pclose<CR>
endif

let &previewpopup=previewpopup
endfunction


Expand Down

0 comments on commit 54b94f9

Please sign in to comment.