GitGutter hides SublimeLinter gutter marks
As it stands now, the GitGutter gutter marks hide the SublimeLinter gutter marks. I would say that lint errors should take precedence here. Maybe you guys can work something out?
:+1:
+1 same bug
A possible fix for this:
- You can get a list of named regions like so:
view.get_regions("git_gutter_inserted") - You can see if a region intersects another region like so:
region_a.intersects(region_b) - GitGutter uses a single point (1 char long) region for each icon, but they are grouped by the region key (e.g. git_gutter_inserted)
- GitGutter adds regions in the bind_icons method
So you could maintain a list (via settings) of regions you do not want GitGutter to overwrite, then check if any of the icons will intersect those regions, and if so, skip it.
something like:
def is_region_protected(self, region):
protected_regions = ["some_region", "some_other_region"] # should be loaded via settings
protected_region_sets = [self.view.get_regions(r) for r in protected_regions]
for regions in protected_region_sets:
for r in regions:
if r.intersects(region):
return True
return False
...
# inside bind_icons method
unprotected_regions = [region for region in regions if not self.is_region_protected(region)]
self.view.add_regions('git_gutter_%s' % event, unprotected_regions, scope, icon)
This however would probably be very inefficient, especially with large lists of protected regions. This should however, give anyone interested in this problem a point in the right direction of how to solve it.
It's not currently high on my list of priorities, but who knows, if I get some free time, I may take a stab at it.
I am not a regular SublimeLinter user, I cannot reproduce this issue.
When I make a change, the GitGutter markers show up almost instantly. Then the SublimeLinter markers show up about a second or two afterwards and coverup any of the conflicting GitGutter markers.
In the screen shot below both lines 2 & 3 have been modified, line 3 is not showing the modified icon, but instead the SublimeLinter illegal icon:

Can someone describe how to reproduce the issue?
seems to be fixed for me, too - can't reproduce anymore.
Same here, looks like it's working now... Did not update anything either. Ghost in the machine?
Everyone ok with closing this issue?
https://github.com/SublimeLinter/SublimeLinter/issues/554
OK, well if no one is having this issue anymore I am going to close this.
I'm having this issue today. Fresh install of ST3 and both SublimeLinter and GitGutter via Package Control. If I remove GitGutter I can see the errors, but if I reinstall it the diffs override the errors.
Not installed:

Installed:

I am facing the same problem. one possible solution would be to have a shortcut key through which I could just toggle the annotations.
I am having the same problem. I personally love GitGutter, but it's so hard to use GitGutter and SublimeLinter at same time for this reason.
I have been having this problem for a few months. It ceased for a day or two when I edited the GitGutter preferences, but came back shortly after.
Using ST3
Looks like it would be worth re-opining this..
I should mention that I have disabled Sublime Linter in favour of GitGutter, because I rely on GitGutter more times a day than I need Sublime Linter :) That said, if a solution was possible, whether it be on GitGutter's end or Linter's end, I would LOVE to have both enabled.
Ultimately, I think if SublimeLinter finds an error, it should take precedence over GitGutter. That would be best of both worlds for me.
Totally. If you're comparing against your main repo (as I do), SublimeLinter isn't ever going to show anything unless the error was actually committed which makes the gutter marks only useful on untracked files
For anyone having an issue, please take a look at the protected-regions branch. I adds a setting where you can set protected regions that git gutter will not override. You will need to check which region names sublime linter uses and set them as protected for git gutter to not override them.
Please try using that branch report pack any issues and if it helped.
Interesting. I am not familiar enough with SublimeLinter to know what needs to be put into that setting's array... anyone have advice?
@JerseyMilker a quick perusal of that packages code I found the erase_lint_marks method. So it looks like they may just be:
- lint-underline-illegal
- lint-underline-violation
- lint-underline-warning
- lint-outlines-illegal
- lint-outlines-violation
- lint-outlines-warning
- lint-annotations
GitGutter also hides SublimeXDebug icons (a very popular sublime package for those who work with PHP), which is very annoying.
A simple workaround would be to have a quick way of enabling/disabling GitGutter (Does this exist already?). That way I could, at least, disable GitGutter when using XDebug and re-enable it once I stop debugging.
@tgirardi is there something wrong with just using Package Control: Disable Package when you are debugging and then using Package Control: Enable Package when you are finished?
Yes, it needs a restart.
@tgirardi I just checked, it seems it doesn't exactly require a restart, it stops git gutter from adding any new marks, but does not remove the current ones. Either way, it's not very convenient for you.
I think that is a valid feature request and worthy of it's own ticket. Feel free to open a new issue and reference this one.
I am not sure what the best solution is, and I am open to suggestions, but I agree - some sort of functionality would be useful.