Sublime Forum

Build 3193

#22

It hides all the other diffs in the view

1 Like

#23

No, when you right click on a line that has a green or yellow vertical bar drawn to the left edge of the gutter, the context menu should have an item “Show Diff Hunk”.

If you still can’t find it, perhaps try temporarily reverting to a clean state to see if you have an override in place.

0 Likes

#24

@wbond Where can I find the default styles for diff.deleted, diff.deleted.char, diff.inserted and diff.inserted.char ?

0 Likes

#25

They are dynamically generated (in C++) based on the color scheme palette.

The current implementation looks like the following when the V channel of the HSV representation of your background color is < 0.6 (on a scale of 0.0 to 1.0), or “dark”:

{
    "scope": "diff.deleted",
    "background": "color(var(--reddish) a(0.15))",
    "foreground_adjust": "l(+ 5%)"
},
{
    "scope": "diff.deleted.char",
    "background": "color(var(--reddish) a(0.3))",
    "foreground_adjust": "l(+ 10%)"
},
{
    "scope": "diff.inserted",
    "background": "color(var(--greenish) a(0.15))",
    "foreground_adjust": "l(+ 5%)"
},
{
    "scope": "diff.inserted.char",
    "background": "color(var(--greenish) a(0.30))",
    "foreground_adjust": "l(+ 10%)"
},

Here is what we use when the V channel is >= 0.6, or “light”:

{
    "scope": "diff.deleted",
    "background": "color(var(--reddish) a(0.15))",
    "foreground_adjust": "l(- 20%)"
},
{
    "scope": "diff.deleted.char",
    "background": "color(var(--reddish) a(0.3))",
    "foreground_adjust": "l(- 30%)"
},
{
    "scope": "diff.inserted",
    "background": "color(var(--greenish) a(0.15))",
    "foreground_adjust": "l(- 20%)"
},
{
    "scope": "diff.inserted.char",
    "background": "color(var(--greenish) a(0.30))",
    "foreground_adjust": "l(- 30%)"
},
2 Likes

#26

On some of my files, the expanded diff view works great. On others, though, I have a white box where the deleted lines would be:

0 Likes

#27

What OS and architecture are you on?

0 Likes

#28

Mid-2015 MacBook Pro. Mojave 10.14.3.

0 Likes

#29
  • Is there a command to stage a hunk? I’m aware of revert, but not the other way.
  • Is there way/command to show all diff hunks in a file at once?
  • Any plans on adding mini_diff highlighting to the minimap? One thing I really miss from GitGutter.
0 Likes

#30

ST doesn’t interface with git directly and has a custom read-only implementation, so there is no way to do that (currently).

2 Likes

#31

We have a great way to view all diff hunks in a file and stage them too - https://www.sublimemerge.com :wink:

5 Likes

#32

Is there way/command to show all diff hunks in a file at once?

I would find it pretty cool to have the side-by-side-diff-view from SM in ST within a dedicated view (to not interfere with layouts) with a plugin-API to assign two files to compare against each other like we can do with the set_reference_document() in the mini_diff.

Any plans on adding mini_diff highlighting to the minimap? One thing I really miss from GitGutter.

Also found my asking myself this question. I disabled the normal gutter icons in GitGutter, but can’t remove/disable the GitGutterShowDiff class as it would break the minimap. So the fundamental changes (calling git diff after each key stroke), can’t be made without breaking this feature.

The main goal for GitGutter was to just provide the list of branches/commits/tags to compare against, and set/reset the reference_document for mini_diff accordingly, while still providing the diff popup, which seems to play well with ST’s mini diff so far.

1 Like

#33

Then is there any sort of API that can interact/query the inline diffs?

Guess this question goes more to the developers. /

1 Like

#34

The current API provides view.set_reference_document() and view.reset_reference_document() to change the base mini diff compares the view’s content against. A plugin could create snapshots or checkout a file from an older commit and ask ST to use it for mini diff.

1 Like