Sublime Forum

Get enhanced scrollbar

#1

I keep switching between Sublime Text and VSCode depending on the usage and there is this feature from VSCode that I keep missing in Sublime Text, the enhanced scrollbar. This feature present on VSCode makes the scrollbar much more useful by displaying indicators for things like modified lines, breakpoints, warnings, errors or search results in a very quick and graphical way that allows to get indicators for the whole file, something that Sublime Text with the minimap/birdview cannot.

Is this a feature on the roadmap or something that could be achieved by an extension?

Regards

2 Likes

#2

I opened a issue on the Sublime Text GitHub issue tracker asking about this feature:

  1. https://github.com/SublimeTextIssues/Core/issues/2072 API to add markers to the scrollbar
1 Like

#3

Basically ST displays all regions in the minimap, which includes find results, changes or errors - depending on packages setting the SHOW_IN_MINIMAP flag or not. I find highlighting stuff in there even better than just printing some confusing colored rectangles to a too wide and ugly looking scrollbar. The only problem might be the scaling of the minimap content, which makes highlighted regions barely visible sometimes.

The minimap should just copy the gutter area functionality. Means adding a region somewhere in the middle of a line should add a gutter marker of defined width to the left (or right) of the minimap.

2 Likes

#4

They are useful to me because I can easily find whether there is a problem on the document, just by looking at the scroll bar. Anyways, there is no reason to not allow adding markers to the scroll bar because anyone else is using the scroll bar space for anything anyway. So what will harm adding some markers to it. However I would argue that they could make the scroll bar extremely ugly or hide it behind it the scroll lines, however the implementation should not allow it to.

I do not think they should be mirrored because differently than the gutter, which as a larger space to show things (all the file lines), the scroll bar has only the window height to show things. Then mirroring could extremely pollute it, with all packages markers.

However, the implementation could be done differently. The current gutter could have a optional parameter which defaults to false. This parameter would decide whether the added mark should be reflected to the scroll bar. However, this would not allow to only add markers to the scrollbar, but not to the gutter.

But still missing the point that, the scroll bar markers are different than the gutter markers. Gutter maker can be any Unicode character, however the scrollbar marker should be just very tiny line, with some characteristic color as red when it is pointing to a line where the Linter is pointing a error on:

image

Anyways, the minimap does not cover all the file lines, as the scroll bar indicador does. So, I still prefer the scroll bar for view important markers.

  1. https://github.com/SublimeTextIssues/Core/issues/1328 Minimap - full map mode
  2. https://github.com/SublimeTextIssues/Core/issues/228 Minimap enhancement: option to scale to entire file’s height?
4 Likes

#5

Therefore ST supports overlay scrollbars which are hidded and therefore don’t distract. Using the minimap for scrolling works so much better.

Then mirroring could extremely pollute it, with all packages markers.

Therefore the flag SHOW_IN_MINIMAP exists to let package authors decide whether to show a retion in the minimap or not.

Gutter maker can be any Unicode character

I didn’t mean to add icons to the minimap. It’s pretty obvious to be a stupid and useless idea. I wrote The minimap should just copy the gutter area functionality. In other words - the way it works. What I mean is the way the “minimap gutter area” is rendered. If you want to add a gutter area like marker (a little colored rectangle) today you need to add a region of 1 or 2 characters of width beginning at the first character of a line. This is kind of sub optimal. The minimap should automatically add a little rectangle to the left of the minimap even if the region covers a word in the middle of a line. The result would be very near to VS Code’s scollbar (which I know very well, too). KDiff3 comes with such a thing, too - never found it helpful. The scrollbar markers are just useless for larger files.

0 Likes

#6

I well, then I think this is why we disagree about this feature. I do not hide the scroll bar, neither the minimap. You seems to not use the scroll bar. I prefer keep a both minimap and a scroll bar visible. Then only for me which uses both, would be useful to have some markers on the scroll bar.

I have no idea about how to use the SHOW_IN_MINIMAP. I searched over the https://www.sublimetext.com/docs/3/api_reference.html but could not find any reference to it. Perhaps it is undocumented? I only found HIDE_ON_MINIMAP for the function add_regions.

But accordingly to our context, I assume the creation of the flag SHOW_IN_SCROLL_BAR should be helpful, to be used to configure whether or not a marker should go on the scroll bar. However, I am not sure how the marker color would be set. Anyways, as long as I can add the marks to the scroll bar and set their coloring, it should be fine.

Again, even if you can add regions to the minimap and make it look like the makers, the minimap still has the problem of not covering all the document, as the scroll bar does. Also, I would not like to add markers to the minimap. The minimap, should be what its name say it is, “a minimap of the code”. At least this is on my perception. I still prefer use the space of the scrollbar, instead of cluttering more things on the minimap area, as it is not showing anything else I need or being used for something else.

That should be your opinion about their usage. In fact, it is coherent because if you try to guide yourself through a big file by the scroll bar marker, you could have difficulty on finding the exactly spot. But the point of having markers is to know that there is a problem on that region of the file. Anyways, you should be able to click on these markers on the scroll bar, to go to the point they are marking, like the Go To Command.

0 Likes

#7

Please don’t remove my minimap marks. They are so useful for linting and search results.

Fortunately I mostly work with code I wrote on my own, which very rarely doesn’t fit into a single minimap page, so I never needed this feature, but for very large files I can see this being useful. Only because the files are too large for the minimap, though.

2 Likes

#8

Of course your code will rarely doesn’t fit into a single minimap page but you can think in case you are work as a maintainer, you read other people source code and many file is large. You will see how the indicators on scrollbar is helpful.

Currently I see only VSCode can do it.

1 Like