Skip to content

Commit e113f07

Browse files
committed
Avoid autocmd side-effects when jumping to/from preview window.
Fixes airblade#379.
1 parent 297678a commit e113f07

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

autoload/gitgutter.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,15 +236,15 @@ function! gitgutter#preview_hunk() abort
236236

237237
silent! wincmd P
238238
if !&previewwindow
239-
execute 'bo ' . &previewheight . ' new'
239+
noautocmd execute 'bo ' . &previewheight . ' new'
240240
set previewwindow
241241
endif
242242

243243
setlocal noro modifiable filetype=diff buftype=nofile bufhidden=delete noswapfile
244244
execute "%delete_"
245245
call append(0, split(diff_for_hunk, "\n"))
246246

247-
wincmd p
247+
noautocmd wincmd p
248248
endif
249249
endif
250250
call gitgutter#utility#restore_shell()

0 commit comments

Comments
 (0)