It hides all the other diffs in the view
Build 3193
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.
@wbond Where can I find the default styles for diff.deleted
, diff.deleted.char
, diff.inserted
and diff.inserted.char
?
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%)"
},
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:
- 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.
ST doesnât interface with git directly and has a custom read-only implementation, so there is no way to do that (currently).
We have a great way to view all diff hunks in a file and stage them too - https://www.sublimemerge.com
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.
Then is there any sort of API that can interact/query the inline diffs?
Guess this question goes more to the developers. /
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.