minimap icon indicating copy to clipboard operation
minimap copied to clipboard

Scroll bar position when toggling minimap off

Open gilbertohasnofb opened this issue 4 years ago • 9 comments

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.

gilbertohasnofb avatar Oct 07 '20 15:10 gilbertohasnofb

@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.

kireerik avatar Nov 05 '20 22:11 kireerik

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

gilbertohasnofb avatar Nov 05 '20 22:11 gilbertohasnofb

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 avatar Nov 06 '20 01:11 kireerik

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;
}

kireerik avatar Nov 06 '20 01:11 kireerik

@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?

gilbertohasnofb avatar Nov 06 '20 17:11 gilbertohasnofb

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.

kireerik avatar Nov 06 '20 20:11 kireerik

@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.

gilbertohasnofb avatar Nov 07 '20 11:11 gilbertohasnofb

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

aminya avatar Nov 09 '20 17:11 aminya

@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!

gilbertohasnofb avatar Nov 10 '20 10:11 gilbertohasnofb