Align wrapped editor elements (anchor?)

I have a pretty basic question regarding alignment of editor cells, which are line wrapped. Let us assume I want to create something like this:

MyFun(arg, arg, arg, arg, arg, arg, arg, arg, arg, arg, arg, arg, arg, arg, arg, arg, arg, arg, arg, arg, arg,
arg, arg, arg, arg, arg, arg, arg, arg, arg, arg, arg, arg, arg, arg, arg, arg, arg)

I tried to create this by using the indent layout together with the indent-layout-wrap-anchor. It isn't working for me:

How can I create the desired editor? How do the anchor tags work?

7 comments

The "indent-layout-wrap-anchor" property set to true on the child collection should be all that's needed. I'm guessing that some of the properties set on some other cell are interfering with this property and so you are not getting the desired layout.

Vaclav

0

I only had the punctuation-left/right style for the brackets. I also tried to leave every editor element at default and only using "indent-layout-wrap-anchor" for the child collection. But even then it isn't working for me.I committed this minimal example to GitHub: https://github.com/fvollmer/MPS-Playground/tree/wrap-anchor.

0

I guess what I'm getting when opening your project is the desired outcome, right? If so, the problem must be somewhere else. What version of MPS are you using?

0

Thank you for your help! It's getting stranger: I just restarted MPS and everything looked correct (like it is in your screenshot). Then I decided to close and reopen MyFun and it was wrong again.

I'm using MPS 2018.3.1 on windows. Any idea on debugging this? Maybe I should try to reset my MPS config.

0

We have not succeeded in reproducing the problem. What is your platform/JDK/MPS version?

0

Just a wild guess, but might what you are observing be related to the "text width" setting in your editor and that the editor tries to put as many objects of a cell collection as possible next to each other? That it somehow tries to put as many cells as possible withing one line (notice that first you have three elements on the wrapped line, then you have two)?

0

I could also hypothetically be a settings issue. Can you export your settings and share with me? Settings can be exported at the "welcome" screen in the "Configure" menu.

Vaclav

 

0

Please sign in to leave a comment.