Avoid asynchronous job while vim is starting.

An asynchronous job at startup evidently triggers a Vim (not NeoVim)
rendering bug in some terminals and/or with certain colorschemes.

Terminals reported to be affected: libvte-based ones such as
gnome-terminal, xfce4-terminal, lxterminal, kitty.

Terminals reported to be unaffected: xterm, urxvt.

Closes #619.
This commit is contained in:
Andy Stewart
2019-07-01 11:24:45 +01:00
parent 8aac968f1a
commit 91471746fe

View File

@@ -147,7 +147,7 @@ function! gitgutter#utility#set_repo_path(bufnr, continuation) abort
call gitgutter#utility#setbufvar(a:bufnr, 'path', -1)
let cmd = gitgutter#utility#cd_cmd(a:bufnr, g:gitgutter_git_executable.' '.g:gitgutter_git_args.' ls-files --error-unmatch --full-name -z -- '.gitgutter#utility#shellescape(s:filename(a:bufnr)))
if g:gitgutter_async && gitgutter#async#available()
if g:gitgutter_async && gitgutter#async#available() && !has('vim_starting')
let handler = copy(s:set_path_handler)
let handler.continuation = a:continuation
call gitgutter#async#execute(cmd, a:bufnr, handler)