Ale: Gitgutter is overwritten by ale

Created on 2 Oct 2016  ·  13Comments  ·  Source: dense-analysis/ale

When using the gitgutter plugin, which adds git changed/added/removed annotations to the left gutter, ale seems to be in competition for the gutter space. I see gitgutter's annotations flash briefly, and are then overwritten when ale finishes processing with either nothing, or with whatever syntax issues ale found.

bug

Most helpful comment

Nah, always raise issues. Otherwise nothing gets fixed. Thank you for
letting me know. :+1:

On Sun, 2 Oct 2016, 17:54 Shookit, [email protected] wrote:

Yeah, I wouldn't normally raise the issue, but it's a fairly popular
plugin, so I figured it would be worth bringing up


You are receiving this because you commented.

Reply to this email directly, view it on GitHub
https://github.com/w0rp/ale/issues/23#issuecomment-250978282, or mute
the thread
https://github.com/notifications/unsubscribe-auth/ADWuvrCpzSoemHqscqHIQNTKCOr_dRusks5qv9O_gaJpZM4KMCj7
.

All 13 comments

I've never used gitgutter myself. I wonder if this plugin can be made to be
compatible somehow. I might look into this a little later. It might be a
simple matter of making one plugin or the other only clear particular types
of signs, or remember which signs were set to clear them again.

On Sun, 2 Oct 2016, 17:50 Shookit, [email protected] wrote:

When using the gitgutter plugin, which adds git changed/added/removed
annotations to the left gutter, ale seems to be in competition for the
gutter space. I see gitgutter's annotations flash briefly, and are then
overwritten when ale finishes processing with either nothing, or with
whatever syntax issues ale found.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/w0rp/ale/issues/23, or mute the thread
https://github.com/notifications/unsubscribe-auth/ADWuvgIM-pQrTbCS-pLILkErIAOGBST8ks5qv9K0gaJpZM4KMCj7
.

Yeah, I wouldn't normally raise the issue, but it's a fairly popular plugin, so I figured it would be worth bringing up

Nah, always raise issues. Otherwise nothing gets fixed. Thank you for
letting me know. :+1:

On Sun, 2 Oct 2016, 17:54 Shookit, [email protected] wrote:

Yeah, I wouldn't normally raise the issue, but it's a fairly popular
plugin, so I figured it would be worth bringing up


You are receiving this because you commented.

Reply to this email directly, view it on GitHub
https://github.com/w0rp/ale/issues/23#issuecomment-250978282, or mute
the thread
https://github.com/notifications/unsubscribe-auth/ADWuvrCpzSoemHqscqHIQNTKCOr_dRusks5qv9O_gaJpZM4KMCj7
.

If I remember well, vim allows only one sign in the gutter, so its quite hard to make those kind of plugins work together.

Similar issue with Syntastic and gitgutter: https://github.com/airblade/vim-gitgutter/issues/1

The best compromise from the thread is to simply display both gitgutter and linter signs, while giving higher preference to linter signs.

Main issue now is that ALE deletes the entire sign column every time https://github.com/w0rp/ale/blob/master/plugin/ale/sign.vim#L35

Instead, it should only find and delete its own signs, like gitgutter does, so that lines that aren't being used for lint errors can still display diff or other symbols
https://github.com/airblade/vim-gitgutter/blob/master/autoload/gitgutter/sign.vim#L13
https://github.com/airblade/vim-gitgutter/blob/master/autoload/gitgutter/sign.vim#L70

For now, you can disable the ALE signs if you only want to see the
gitgutter signs. There's a global variable you can set to 0 in your
vimrc, written in the flags file.

I just added support for displaying both sets of signs at the same time now. Try it out. Let me know if I broke everything horribly, let me know what works, etc. Here is how I went about it.

  1. I added some options for setting the sign IDs, which must be numbers, with a rather high offset beyond what gitgutter uses. There are some new globals you can modify to change these. I'll document these in the eventual documentation I intend to write for all of the global variables you can set.
  2. I now parse the current sign IDs specific to ALE, and attempt to remove only the signs we placed.
  3. I moved the "always keep the gutter open" code around so it lies entirely in the sign.vim file now.

One issue might be that the ALE signs might not take precedence properly. I'll let someone who uses ALE and gitgutter together check that. It's probably not that hard to fix if that's happening.

I noticed that error signs stoped to dissapear:
https://asciinema.org/a/7zxbqvad07iyf5f151s9bjc4y

Just gave it a try, everything looks great on my end!

@deathmaz Did I introduce a bug with it not clearing signs, perhaps? Try pulling the latest code and see if the signs are ever removed.

I'll let the dust settle on this issue a little until everything seems to be working well.

Everything works fine after update 👍
Thank you!

Is ale signs suppose to overwrite git signs?

I am using https://github.com/mhinz/vim-signify, and also tried https://github.com/airblade/vim-gitgutter.

ALE is supposed to avoid removing other signs if it can. I suppose it could display over top of other signs. If you have a specific issue, open a GitHub issue for it, and I or someone else can take a look. There are a few documented options for changing the IDs ALE uses for signs, in an attempt not to conflict with other plugins. ALE parses :sign place output to try and identify its signs when removing signs, rather than clearing everything.

Was this page helpful?
0 / 5 - 0 ratings