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

Scroll bar position when toggling minimap off #708

Open
gilbertohasnofb opened this issue Oct 7, 2020 · 9 comments
Open

Scroll bar position when toggling minimap off #708

gilbertohasnofb opened this issue Oct 7, 2020 · 9 comments
Labels

Comments

@gilbertohasnofb
Copy link

When Minimap is toggled on (absolute mode disabled, right-hand side), the scroll bar of the text below it is placed to its left:

Screenshot from 2020-10-07 16-20-02

Toggling Minimap off with minimap:toggle will simply remove Minimap, but leave the space behind it:

Screenshot from 2020-10-07 16-20-12

Disabling the package altogether will move the scroll bar to where it would be normally placed:

Screenshot from 2020-10-07 16-20-33

My suggestion on how to tackle this: either move the scroll bar to the right hand side of minimap (regardless of absolute mode), or alternatively move it there at least when minimap is toggled off.

@kireerik
Copy link

kireerik commented Nov 5, 2020

@gilbertohasnofb I have created some custom styles to place the scroll bar to it's original place while this package is enabled. I can share it here if you are interested.

@gilbertohasnofb
Copy link
Author

@kireerik Yes, that would be great, thank you so much!

@kireerik
Copy link

kireerik commented Nov 6, 2020

I have also made it narrower. So you may meed to adjust the code if you would like to use the default width:

atom-text-editor atom-text-editor-minimap {
	min-width: 5.74vw;
	max-width: 5.74vw;
	right: calc(.5px + 4px + 5px);
}
atom-text-editor[with-minimap] > div, atom-text-editor[with-minimap] > div .scroll-view {
	contain: size layout !important;
	overflow: visible !important;
}
atom-text-editor[with-minimap] > div .scroll-view .vertical-scrollbar {
	right: -5.74vw !important;
}

@kireerik
Copy link

kireerik commented Nov 6, 2020

As a bonus with these styles the visible area indicator behaves as it does in Sublime Text if you need this as well:

atom-text-editor atom-text-editor-minimap .minimap-visible-area::after {
	opacity: 0;
	transition: all .3s ease-out;
}
atom-text-editor atom-text-editor-minimap:hover .minimap-visible-area::after {
	opacity: 1;
	transition: all .05s ease-in;
}

@gilbertohasnofb
Copy link
Author

@kireerik These are really cool, thank you so much for sharing these. It works really well with a single pane, but I am having issues when I have two panes side by side: the scroll bar disappears. I believe minimap gets smaller in those situations, so the line

atom-text-editor[with-minimap] > div .scroll-view .vertical-scrollbar {
	right: -5.74vw !important;
}

would need to account for that. Would you have some suggestion on how to tackle it?

@kireerik
Copy link

kireerik commented Nov 6, 2020

You are welcome!

Setting the min-width as well for the minimap element helps. I have updated my previous comment.

With this adjustment it is fine. With Soft Wrap disabled it would still require some more work.

Would be nice if this package would have this option built in.

The scrollbar looks much nicer on the very edge of the pane.

@gilbertohasnofb
Copy link
Author

@kireerik Thank you so much for the updated. This does indeed fixes the issue with the disappearing scroll bar, but forcing the minimal width to a large value does end up leaving a large gap between the contents of minimap and the scrollbar when files are viewed side by side, e.g.:

image

Would be nice if this package would have this option built in.

Indeed, as much as I appreciate your tips above and will make use of your snippets, this should definitely be implemented in the pacakge itself.

@aminya
Copy link
Collaborator

aminya commented Nov 9, 2020

Hey everyone. Minimap is abandoned. Please post your issues in minimap-plus:
https://atom.io/packages/minimap-plus

@gilbertohasnofb
Copy link
Author

@aminya thank you so much! I started making use of it and I will report this over there. Great to see a fork picking up this project!

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

No branches or pull requests

4 participants