atom-minimap / minimap

A preview of the full source code.
https://atom.io/packages/minimap
MIT License
646 stars 129 forks source link

Editor tab ‘blends’ into minimap if it is on left and multiple panes are open #782

Closed bassamanator closed 3 years ago

bassamanator commented 3 years ago

I prefer my minimap on the left but this is what happens to it: image

It doesn't always happen, it just happens sometimes, specially when having multiple panes open.

When I move the minimap to the right side of the code editor window (which I don't like), the problem goes away.

1.54.0 Operating System: Manjaro Linux KDE Plasma Version: 5.20.5 KDE Frameworks Version: 5.78.0 Qt Version: 5.15.2 Kernel Version: 5.10.7-3-MANJARO OS Type: 64-bit Processors: 16 × AMD Ryzen 7 2700X Eight-Core Processor Memory: 31.4 GiB of RAM Graphics Processor: Radeon RX 580 Series

UziTech commented 3 years ago

I am unable to reproduce this. Is there any way you can get more specific about when it happens?

bassamanator commented 3 years ago

I wish I could tell you. I cannot reproduce this problem myself but it happens all the time.

To escape this issue, I had switched the minimap to the right side of the editor. I've switched it back to the left (the setting under which this problem occurs) and I'm going to wait for it to happen then I'll report back here with more details.

At this point, as far as I can tell, the necessary conditions are: -minimap on the left. -2 editor panes at least. -resizing the panes. I use a package called hey-pane that enlarges the current pane for you, just the way you would manually. hey-pane itself is not a necessary condition because the problem occurs without the use of hey-pane as well.

UziTech commented 3 years ago

Ah, resizing is the key. It looks like there is some issue with making the editor the correct size while resizing.

minimap-resize

aminya commented 3 years ago

I think we should issue a notification about the issue when multiple panes are open and minimap is on left, and suggest moving the Minimap to the right if they want to avoid this issue.

I used a crude hack for moving the scrollbar to the right when Minimap becomes hidden by the toggle command. This enforces the placement of the borders. However, this is a very bad solution for the regular situation. I prefer letting the user know about this limitation instead of trying to hack it in a crude way. https://github.com/atom-minimap/minimap/blob/64ee4b0fc60d765ae4832d22e6fe28b0778b2c85/lib/main.js#L171

bassamanator commented 3 years ago

Ah, so I'm stuck with minimap on the right :/

In any case, I can't live without this package. Keep up the good work guys! :+1:

UziTech commented 3 years ago

I'll take a look at this tonight and see if there is an easy fix.

UziTech commented 3 years ago

I see the problem is that minimap calculates the width and tries to move the editor to the right by that width. The problem is when there are multiple minimaps they might each have different widths but it has to choose one.

This seems like it can be solved by calculating each visible minimap on resize and compensating editors differently. I'll work on this in the next few days.

UziTech commented 3 years ago

Actually that was easier than I thought. #783 should fix this. I just need to test it a little more to make sure it doesn't break anything else.

bassamanator commented 3 years ago

I'd love to help in testing if you need.

UziTech commented 3 years ago

Sure, You can install the branch https://github.com/UziTech/minimap/tree/left-width to test it out

  1. uninstall minimap
  2. clone https://github.com/UziTech/minimap/tree/left-width
  3. run npm i in the cloned folder
  4. run apm link
github-actions[bot] commented 3 years ago

:tada: This issue has been resolved in version 4.39.8 :tada:

The release is available on:

Your semantic-release bot :package::rocket: