airblade/vim-gitgutter

loading through CursorHold doesnt work out

Ckath opened this issue · 2 comments

Ckath commented

What is the latest commit SHA in your installed vim-gitgutter?

ded1194

What vim/nvim version are you on?

VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Aug 02 2022 21:22:22)

this whole idea where you call the gitgutter CursorHold autocmd instead of doing it on startup/bufread here:

execute 'doautocmd' s:nomodeline 'gitgutter CursorHold'

doesnt work when the user has disabled the autorefreshing with the suggested

" .vim/after/plugin/gitgutter.vim
autocmd! gitgutter CursorHold,CursorHoldI

I'd prefer if it was checked if gitgutter CursorHold was still set before calling it, reverting to the old way of just doing it on initial load if needed. now it gives a No matching autocommands: gitgutter CursorHold after a few seconds without actually loading when you have the CursorHold autocmd disabled.
or alternatively, keep the timer and just call gitgutter there instead of the doautocmd CursorHold

I'm away but I'll look into this when I get back.

Thanks for reporting this. It should be fixed by 7808c48.