Avoid floating preview window immediately closing itself

Fixes #728.
This commit is contained in:
Andy Stewart
2020-08-07 12:06:17 +01:00
parent 82f3ea6a40
commit 8005f71aab

View File

@@ -243,6 +243,11 @@ augroup gitgutter
autocmd BufEnter * call s:on_bufenter() autocmd BufEnter * call s:on_bufenter()
" Ensure Vim is always checking for CursorMoved to avoid CursorMoved
" being fired at the wrong time in floating preview window on Neovim.
" See vim/vim#2053.
autocmd CursorMoved * execute ''
autocmd CursorHold,CursorHoldI * call gitgutter#process_buffer(bufnr(''), 0) autocmd CursorHold,CursorHoldI * call gitgutter#process_buffer(bufnr(''), 0)
if exists('*timer_start') && has('lambda') if exists('*timer_start') && has('lambda')
autocmd FileChangedShellPost * call timer_start(1, {-> gitgutter#process_buffer(bufnr(''), 1)}) autocmd FileChangedShellPost * call timer_start(1, {-> gitgutter#process_buffer(bufnr(''), 1)})