sublimehq / sublime_text

Issue tracker for Sublime Text
https://www.sublimetext.com
803 stars 39 forks source link

Git diff markers on minimap/scrollbar #2696

Open kakysha opened 5 years ago

kakysha commented 5 years ago

Would love to see git diff markers on minimap along with a gutter to quick click and scroll to recently changed lines

GitGutter plugin does that and thats the last reason I keep that plugin installed.

jdgregson commented 5 years ago

I strongly agree. This is a feature I'm missing from GitGutter and I came here just to open this same request.

When working with several functions throughout a large source file it is extremely helpful to have recent changes visible in the minimap. Locating the relevant changes again and again by scrolling and looking for changes in the gutter is far more tedious than just clicking back and forth in the minimap.

wbond commented 5 years ago

We originally considered this, but haven't committed to it, mostly from a performance perspective.

@jdgregson I highly recommend checking out the key bindings to jump between modifications. I've found them to be a significant improvement in my code navigation: https://www.sublimetext.com/docs/3/incremental_diff.html#navigation.

jdgregson commented 5 years ago

@wbond Thanks, I hadn't seen that before. I'll see if I can get used to it, but it seems pretty memorable. One thing that I find slightly annoying with the keyboard shortcuts is that it selects the entire changed block when I go to the next/previous change. I'd rather it just go to the first changed character on the first changed line. Or ideally (and this may also pose a performance penalty) it would go to the last position the cursor was in within that changed block.

greneholt commented 5 years ago

Even if it has a performance penalty, the increase in usability is worth it IMO, especially if it was configurable. The minimap gives me a birds-eye view of the state of the file, and I found it very helpful with GitGutter to be able to see a birds-eye view of the changes too.

keith-hall commented 5 years ago

I wonder if the API suggestion from https://github.com/SublimeTextIssues/Core/issues/2666 were to be implemented, maybe plugins could handle drawing on the minimap using the existing add_regions API when the view is modified?

YuriGor commented 5 years ago

Highlighting pixel with color on the left border of minimap - why it is a performance issue? Isn't minimap just an image re-rendered on change only?

wbond commented 5 years ago

The incremental diff functionality stores every edit to the buffer. To display the gutter we have to analyze the changes to determine what kind of change the edits to a line should be classified as. Currently we only do that for the number of lines viewable within the viewport (say maybe 50-100 on a large screen). Doing so for the Minimap could easily require analyzing the changes for 500-1000.

YuriGor commented 5 years ago

For minimap will be enough just to reflect the fact of any change happened with line, without analysis. Nobody will need to distinguish type of edit right on the minimap - it's unreadable. But it's still useful to see if some block of code was changed some way or not.

seleznevdev commented 5 years ago

This is the most waiting feature for me :cry:

seleznevdev commented 4 years ago

Still hope, still believe... :neckbeard:

YuriGor commented 4 years ago

Just an example, how it's done in VS Code (green - new, blue - changed and read deleted but it may depend on color scheme, not sure)

image

As you see they have this feature even in a double amount:

by the left side of the minimap and, a bit zoomed in, by the right side.

on left side markers are scrolling with the minimap, and on the right side, they placed right on the scrollbar body as a background, so you can jump to any marker on the page by clicking on it - you will actually click on the scrollbar.

seleznevdev commented 3 years ago

Still hope, still believe... :neckbeard:

Gabriel-p commented 3 years ago

Wasn't there a package that was able to do this? I could swear I've seen this functionality in ST

deathaxe commented 3 years ago

GitGutter adds markers to minimap but there's no API to do the same for scrollbars. The latter one makes only limited sense for those using overlay scrollbars anyway. They are hidden most of the time.