lambdalisue / vim-gina

👣 Asynchronously control git repositories in Neovim/Vim 8
http://www.vim.org/scripts/script.php?script_id=5531
MIT License
687 stars 27 forks source link

How to update `gina#component#traffic#preset()` in the background #301

Closed GordianDziwis closed 2 years ago

GordianDziwis commented 2 years ago

The traffic statusline component only gets updated when doing a !gina status or :!git status. Is it possible to keep it updated automatically in the background?

lambdalisue commented 2 years ago

It should be updated automatically. Do you use git command in terminal or so on?

GordianDziwis commented 2 years ago

When I run git status in an external terminal it gets updated.

But also only after I run some kind of status command. I tried it with a minimal vimrc;

set nocompatible
filetype off

call plug#begin('~/.neovim/bundle')
Plug 'lambdalisue/gina.vim'
call plug#end()

syntax on

NVIM v0.7.0-dev and gina is abdbe0fe33f3b6fc59e94f7cc3072768f8dfd8ac

lambdalisue commented 2 years ago

Thanks for a minimal vimrc but it seems the vimrc does not have gina#component#traffic#preset(). How can I reproduce your situation?

GordianDziwis commented 2 years ago
  1. Checkout a github repo
  2. Open file in repo with vim
  3. In vim :echo gina#component#traffic#preset() # Empty
  4. Create a commit with the github GUI
  5. In vim :echo gina#component#traffic#preset() # Empty, but should show that local branch is one commit behind,
  6. Do a git status
  7. In vim :echo gina#component#traffic#preset() # Now it shows that the local branch is behind
lambdalisue commented 2 years ago

Finally, I got your situation. I'm sorry but it's feature. Gina watch the last modified data of .git/index thus cannot detect changes on remote until git itself update .git/index or so on.

GordianDziwis commented 2 years ago

Thanks, then I'll use an autocommand.