Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gitgutter is overwritten by ale #23

Closed
Shookit opened this issue Oct 2, 2016 · 13 comments
Closed

Gitgutter is overwritten by ale #23

Shookit opened this issue Oct 2, 2016 · 13 comments
Labels

Comments

@Shookit
Copy link

Shookit commented Oct 2, 2016

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.

@w0rp
Copy link
Member

w0rp commented Oct 2, 2016

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, notifications@github.com 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
#23, or mute the thread
https://github.com/notifications/unsubscribe-auth/ADWuvgIM-pQrTbCS-pLILkErIAOGBST8ks5qv9K0gaJpZM4KMCj7
.

@Shookit
Copy link
Author

Shookit commented Oct 2, 2016

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

@w0rp
Copy link
Member

w0rp commented Oct 2, 2016

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

On Sun, 2 Oct 2016, 17:54 Shookit, notifications@github.com 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
#23 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/ADWuvrCpzSoemHqscqHIQNTKCOr_dRusks5qv9O_gaJpZM4KMCj7
.

@KabbAmine
Copy link
Contributor

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

@prashcr
Copy link
Contributor

prashcr commented Oct 2, 2016

Similar issue with Syntastic and gitgutter: airblade/vim-gitgutter#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

@w0rp
Copy link
Member

w0rp commented Oct 2, 2016

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.

@w0rp w0rp added the bug label Oct 3, 2016
@w0rp
Copy link
Member

w0rp commented Oct 4, 2016

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.

@deathmaz
Copy link
Contributor

deathmaz commented Oct 4, 2016

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

@Shookit
Copy link
Author

Shookit commented Oct 4, 2016

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

@w0rp
Copy link
Member

w0rp commented Oct 4, 2016

@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.

@deathmaz
Copy link
Contributor

deathmaz commented Oct 5, 2016

Everything works fine after update 👍
Thank you!

@tonglil
Copy link

tonglil commented Feb 1, 2017

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.

@w0rp
Copy link
Member

w0rp commented Feb 3, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants