Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Scrollbar to Minimap #414

Closed
MarkOSullivan94 opened this issue Nov 25, 2015 · 11 comments
Closed

Add Scrollbar to Minimap #414

MarkOSullivan94 opened this issue Nov 25, 2015 · 11 comments

Comments

@MarkOSullivan94
Copy link

Hi, I'd love the ability to be able to scroll only inside the minimap so I can locate the area of code I wish to view and then I can click on it on the minimap to take me there.

I'm currently working with long files and I find it a bit frustrating having to click at the top / bottom of the minimap a couple of times to get to the section I want to view, I'd prefer it if I could just scroll to that point on the minimap and then click on the minimap to take me to that section.

Would it be possible to get this introduced? Thanks!

@MarkOSullivan94 MarkOSullivan94 changed the title Add Scrollbar to Minimap [enhancement] Add Scrollbar to Minimap Nov 25, 2015
@MarkOSullivan94 MarkOSullivan94 changed the title [enhancement] Add Scrollbar to Minimap Add Scrollbar to Minimap Nov 25, 2015
@abe33
Copy link
Contributor

abe33 commented Nov 27, 2015

Hi @MarkOSullivan94, looks like an interesting feature, but as I see it, it'll have to be toggled through a setting, as most users comes from ST, they expect scrolling above the minimap to just scroll the editor. Also, it would mean that if you scroll over the minimap to reach the bottom of the file, then either scroll in the editor - that is still on its previous scroll top position, no longer synced with the minimap - or clicking in the minimap - which in response will scroll the editor - the minimap will have to be synced again with the editor, which mean some kind of jump in its display.

Also, did you know you could drag the viewport highlight rectangle to scroll over the whole file in a single motion?

@MarkOSullivan94
Copy link
Author

@abe33 thanks for getting back to me.

I only suggest for the scroll to work if you click (or moused over) on the column which contains the minimap. If you scroll while the the code contained within your file is active, ie you have clicked on the section containing the code (or moused over it) it should just scroll your code as normal. If you scroll to the bottom of the minimap, it shouldn't allow you to scroll any more.

I never knew about the ability to drag the highlighted rectangle, just tried it out there now and it'll definitely speed me up, so thanks!

@abe33
Copy link
Contributor

abe33 commented Nov 27, 2015

Now that I read again, I'm no longer sure I understand.

What I understood: When using the mousewheel over the minimap, the minimap itself scrolls without affecting the editor. As clicking on the minimap will bring you to the corresponding line in the editor it make sense to scroll the minimap independently of the editor to reach some line not immediately visible in the minimap.

Is that what you were suggesting or did I misunderstand you?

@MarkOSullivan94
Copy link
Author

Exactly what I meant. Sorry for the confusion!

@abe33
Copy link
Contributor

abe33 commented Nov 27, 2015

Ok that's great, it'll take me some time to think about the potential side effects, but I don't see much issue in implementing it.

@abe33
Copy link
Contributor

abe33 commented Mar 6, 2016

It's now available in v4.20

@kankaristo
Copy link

This is a great feature, although I had no idea I wanted it until it was added...

However, there seems to be a bug (or strange feature): the minimap's scroll position resets after what feels like a fixed delay (~2 seconds).

I'd think that it should only reset if the cursor position in the editor changes, or if I scroll in the editor?

And when it resets, a "smooth scroll" transition would be nice; otherwise it's a bit of an abrupt jump. But that's a minor thing.

@abe33
Copy link
Contributor

abe33 commented Mar 10, 2016

@kankaristo I don't get this reset after Xs, could it be you have a plugin that is somehow triggering a scroll event on the editor?
As for the smooth animation it makes sense, I'll see what I can do.

@MarkOSullivan94
Copy link
Author

Thanks for implementing this feature @abe33 !

@abe33
Copy link
Contributor

abe33 commented Mar 14, 2016

@kankaristo The latest version includes the smooth animation when scrolling to a line in the editor by clicking on the minimap. Actually, the scroll animation is now completely independent, which means that the minimap will scroll the minimum amount of distance to reach the target while the editor scroll on its own animation.

@kankaristo
Copy link

Thanks! The resetting was caused by branch-status.

I don't think that it generates a scroll event, but it does modify the DOM (the status bar) every 2 seconds... It's a pretty minor bug though, so I think I'll just live with it. :P

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants