onivim / oni2

Native, lightweight modal code editor
https://v2.onivim.io
MIT License
7.83k stars 281 forks source link

SCM: Git markers don't show up in gutter when file is specified in CLI #3034

Open jerabaul29 opened 3 years ago

jerabaul29 commented 3 years ago

How to get a git gutter, similar to:

https://github.com/airblade/vim-gitgutter

?

It does not seem to be built in, I cannot find a good match in the extensions (maybe I am missing something). This is super convenient in daily life, wonder if this should even be built in natively (?).

jerabaul29 commented 3 years ago

Ok, after doing a bit more testing - there is well some gitgutter like stuff inside onivim2, but it seems that it does not always display.

For example, I was editing this file, and noticed no gitgutter - hence opening this issue. But going back to the file later, ie the file had been open in onivim2 for a few tens of minutes, the gitgutter behavior showed up:

Screenshot from 2021-01-23 11-43-22

But on this other file, no gitgutter displaying:

Screenshot from 2021-01-23 11-43-18

Any idea why? Is that a bug?

jerabaul29 commented 3 years ago

Ok, I think that there is something not triggering as it should or something like this. In the second case, if I:

Then the gitgutter like thing displays (see screenshot), as it should have from the start

Screenshot from 2021-01-23 11-50-41

bryphe commented 3 years ago

Thanks @jerabaul29 for the issue!

Right, the git gutters should "just work" for any file opened up in a git repo with the out-of-box git extension.

I believe this may be the same underlying issue as https://github.com/onivim/oni2/issues/2185 - in both cases, when loading a file via oni2 qrdump.sh - that very first file loaded doesn't get sync'd properly to the extension host, resulting in these issues (incorrect language services, warnings in log, and diff markers not populated correctly)