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

Minimap / Split View issue #358

Closed
rm-code opened this issue Jul 4, 2015 · 8 comments
Closed

Minimap / Split View issue #358

rm-code opened this issue Jul 4, 2015 · 8 comments
Labels

Comments

@rm-code
Copy link

rm-code commented Jul 4, 2015

Hello,

I wasn't sure wether to report this bug here or in the markdown-preview repository. When the minimap is on the right and I toggle the markdown preview, the minimap is automatically transferred to the left side of the screen.

screenshot 2015-07-04 10 08 13

(Had to toggle the tree-view to make the minimap options visible. As you can see it still thinks it is on the right side of the screen and the option panel is displayed offscreen)
screenshot 2015-07-04 10 08 50

When I untoggle the markdown preview, the minimap is not restored to its original place.
screenshot 2015-07-04 10 09 01

Best wishes
Robert

@abe33
Copy link
Contributor

abe33 commented Jul 4, 2015

Interesting, I never seen that happens (I also use Markdown Preview a lot), it looks like the minimap position setting was not changed in the process, can you confirm it? The value for minimap.displayMinimapOnLeftshould be false.
If not then some code has changed the setting in the process, but I have no clue why it happens.
If yes, then maybe there's some CSS issue at some point, the minimap make use of the flex box display used by the text editor, but the order of the elements in the layout can be changed directly from CSS, can you inspect the minimap to see if there's a flex-order that applies at some point on the minimap or on the text editor?

@rm-code
Copy link
Author

rm-code commented Jul 4, 2015

In the config file the value for minimap.displayMinimapOnLeft is omitted (so I guess it defaults to 'false').

I couldn't find a flex-order on inspection, but I am not too familiar with the inspection tool and the CSS / styling code.

@abe33 abe33 added the bug label Jul 6, 2015
@abe33
Copy link
Contributor

abe33 commented Jul 7, 2015

Can you tell me what is the position of the atom-text-editor-minimap element in the DOM before and after the side switch? Maybe it detaches and attaches itself at the wrong place (which would be weird, but I don't see any other reason for that behavior)

@rm-code
Copy link
Author

rm-code commented Jul 9, 2015

But I noticed something different. It doesn't just happen with the markdown preview, it also happens when I split the view myself. I hope this helps:

screenshot 2015-07-09 11 38 24
screenshot 2015-07-09 11 39 37

@rm-code rm-code changed the title Minimap / Markdown Preview issue Minimap / Split View issue Jul 9, 2015
@abe33
Copy link
Contributor

abe33 commented Jul 9, 2015

This is really weird, the minimap is inserted at the wrong place, but I can't figure why nobody else has reported the same behavior.
If the setting doesn't change there's no reason for the minimap to be inserted elsewhere than at the end of the children list.
What's even weirder is that the second minimap on a pane split is positionned at the right place. So it can't be that the config changed.

If you can try something in the console for me when it occurs:

e = atom.workspace.getActiveTextEditor()
minimap = atom.packages.getLoadedPackage('minimap').mainModule
m = minimap.minimapForEditor(e)
v = atom.views.getView(m)
v.displayMinimapOnLeft

The last line should return false if the minimap is in sync with the config, if it's true then that explain why the minimap swapped place, but the question would then be why this value was changed in the process.
If it's still false then I don't understand what could produce that.

When I test that myself with some debug code in the attach and detach hooks of the minimap element, I only get one attach call when I split a pane, which should indicate that the element is not removed from the text editor.

By curiosity, do you get the same result with displayMinimapOnLeft enabled? Does the minimap swap to the right on a split pane or does it stay on the left?

If it don't change position it could indicate than the content of the text editor is destroyed and then recreated after the minimap. But you'll be the only person I know that experience that when splitting panes.

@rm-code
Copy link
Author

rm-code commented Jul 9, 2015

By curiosity, do you get the same result with displayMinimapOnLeft enabled? Does the minimap swap to the right on a split pane or does it stay on the left?

Just tested it: If I use the "Left" option both views will have the minimap on the left side. This seems to be a problem exclusively with the "right" position.

The last line should return false if the minimap is in sync with the config, if it's true then that explain why the minimap swapped place, but the question would then be why this value was changed in the process.
If it's still false then I don't understand what could produce that.

It returns false here :(

Not sure if this is relevant, but the wrongly placed minimap will only update it's position after I actually put it on the side it is on ... Let me try to explain it a bit better:

  1. Minimap is on the right
  2. Split Panes
  3. Minimap is now on the left (but the minimap option still shows "Right)
  4. When I click on the "right" option now, I get no reaction
  5. When I click on the left option nothing happens either (since the minimap is already on the left)
  6. Now clicking on "right" updates the position correctly

@abe33 abe33 closed this as completed in 89c3b03 Jul 9, 2015
@abe33
Copy link
Contributor

abe33 commented Jul 9, 2015

I believe the patch in v4.11.2 should solve this issue, the minimap no longer rely on the node position for the layout, but instead it uses the order property of flexbox content to appear before the editor. So whatever the order is the layout should always be the same. Let me know if you still have an issue with this.

@rm-code
Copy link
Author

rm-code commented Jul 10, 2015

Just downloaded 4.11.2 and everything works as expected! Cool, that you found a fix for this 👍

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

2 participants