Ensure older vims process buffer at startup

In this context older vims are those without timer_start() and lambda.

The plugin always used to process the buffer at startup.  Then in #734
an optimisation was introduced to defer processing at startup, to keep
vim's startup fast.  However in this optimisation older vim's
unintentionally lost their startup processing altogether.
This commit is contained in:
Andy Stewart
2022-08-22 09:42:07 +01:00
parent 7808c48c7b
commit 52d0066823

View File

@@ -247,6 +247,8 @@ function! s:on_bufenter()
if has('vim_starting') && !$VIM_GITGUTTER_TEST if has('vim_starting') && !$VIM_GITGUTTER_TEST
if exists('*timer_start') && has('lambda') if exists('*timer_start') && has('lambda')
call s:next_tick("call gitgutter#process_buffer(+".bufnr('').", 0)") call s:next_tick("call gitgutter#process_buffer(+".bufnr('').", 0)")
else
call gitgutter#process_buffer(bufnr(''), 0)
endif endif
return return
endif endif