jisaacks / GitGutter

A Sublime Text 2/3 plugin to see git diff in gutter
MIT License
3.88k stars 225 forks source link

ST4 - Line annotation background color looks ugly #552

Closed pvanb closed 4 years ago

pvanb commented 4 years ago

Description

With the newest version of GitGutter the line annotations for ST4 use the background color of the current color scheme, but this looks ugly when using the "highlight_line": true option.

Screen Shot 2020-06-19 at 7 25 33 PM

I propose either the background be set back to transparent (as it is in ST3) or have it be configurable in the same way the foreground is:

"rules":
[
    {
        "scope": "comment.line.annotation.git_gutter",
        "foreground": "#586e75",
        "background": "#073642", // or just "transparent"
    }
]

Support Info

kqf commented 2 years ago

@deathaxe I've just updated to ST4 and I am still having this issue. I probably overlooked something, but could you tell me how to fix that?

image

Another question is, why the text is so indented to the right if compared to the SBT3 version: image

I have removed the commit has from the annotations although this didn't help much.

EDIT: In both cases I have the default option"line_annotation_ruler": false, but this still appears 😢

Support Info

deathaxe commented 2 years ago

The transparent background color applied by 9017050 caused rendering issues when hovering the annotation with some builts of ST4 and was therefore reverted by 8b5dd2345331f704958225dd3d6fecb46de6597d. It appears ST4126 handles them correctly again.

GitGutter uses normal phantoms when running with ST3. They suffer some edge cases with soft wrapped lines. SublimeHQ's solution for this issue is a new feature called "annotations" in ST4. These are phantoms located at the very right edge of a view, which optionally create popups when hovering. A plugin can't control the location nor the amount of text being displayed.

The "line_annotation_ruler" specifies whether the annotation text starts right at the end of a line or not before a ruler's column (if one is set up). GitGutter prepends spaces to achieve that. As this is used by normal phantoms, the setting applies to ST3 only.

It may be required to close and reopen a view or restart ST to make some of those settings apply after a change as GitGutter caches many of them to avoid creating required templates after every key press. As those settings don't change frequently I haven't put any effort into fixing those caching edge cases.

kqf commented 2 years ago

@deathaxe Thank you for taking your time to answer my questions. I understood the part about "line_annotation_ruler", but I still don't know how to solve the background color issue. Is it solvable or not?

PS: I still prefer GitGutter over the incremental diff ❤️

deathaxe commented 2 years ago

The background color is hardcoded. You could have a look at the commits and patch the files yourself. As most recent ST4 is able to handle transparent well again, I am fine to revert the latter one again.

kqf commented 2 years ago

Now I got it, thanks. I will play myself and probably let you know (probably tomorrow or later this week) in this thread