From 8005f71aabef13f5872b3ef4802f36503a16c451 Mon Sep 17 00:00:00 2001 From: Andy Stewart Date: Fri, 7 Aug 2020 12:06:17 +0100 Subject: [PATCH] Avoid floating preview window immediately closing itself Fixes #728. --- plugin/gitgutter.vim | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugin/gitgutter.vim b/plugin/gitgutter.vim index 0576f87..bf4f6fe 100644 --- a/plugin/gitgutter.vim +++ b/plugin/gitgutter.vim @@ -243,6 +243,11 @@ augroup gitgutter 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) if exists('*timer_start') && has('lambda') autocmd FileChangedShellPost * call timer_start(1, {-> gitgutter#process_buffer(bufnr(''), 1)})