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

two problems encountered trying to add newline to "expand..." text #3404

Open
brianharvey opened this issue Oct 12, 2024 · 4 comments
Open

Comments

@brianharvey
Copy link
Collaborator

So, sathvikrias posted this improved IF reporter in the forum:

IF BLOCK script pic(3)

untitled script pic (4)

untitled script pic (5)

I really like that, but if you have more than one ELSE IF the block gets very wide very quickly, so I wanted to put a line break before the words "else if" so I tried "$nl else if" and got this:

untitled script pic (3)

That's the first problem; $symbol names should end at a space and be mixable with other text. The second problem is that, having read about some feature involving "%nl" I also tried "%nl else if." Having done that, I am unable to click OK on the block editor. No error message, it just silently doesn't close (but it does change the block, badly). Even if I delete the "%nl" in the "expand..." option, that doesn't let me click OK. All I can do is click Cancel, which leaves me with the messed up version of the block.

@brianharvey
Copy link
Collaborator Author

P.S. I think he's right that (after fixing the nl problem) we should change the primitive to do this.

@jmoenig
Copy link
Owner

jmoenig commented Oct 12, 2024

that's right, newlines and symbols currently cannot be mixed with other label elements in the expansion tokens. Known (because I didn't yet need it, and on my list.
I don't want to add a variadic if/else reporter just yet, I'm not convinced... but let's discuss this sometime offline (in a few weeks). Also he probably shouldn't be using RESHAPE...

@brianharvey
Copy link
Collaborator Author

P.P.S. I did more playing around with how the block is line wrapped and got this:

untitled script pic (6)

That's pretty hideous, imho. I get that you're treating the entire multi-line input group as a single token for purposes of wrapping the overall expression, but it took quite a while for me to see that the ELSE floating by itself at the right edge isn't vertically aligned with the text starting THEN.

I agree in principle that it's good to keep the input group together, but if so, it should be followed by a newline automatically. And also if it needs to be broken, do it at a group boundary (so the line starting THEN would instead start with the ELSE IF that comes before it).

Happy to discuss later, but why not RESHAPE?

@jmoenig
Copy link
Owner

jmoenig commented Oct 12, 2024

the solution to this is going to be letting block authors insert newlines where they wish to.
What's the point of RESHAPE here, what does it do, and why? Did you try leaving it out?

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

No branches or pull requests

2 participants