Tectato / BetterCommandBlockUI

A fabric mod providing a more usable UI for Bommand Blocks
Creative Commons Zero v1.0 Universal
32 stars 7 forks source link

Auto wrap at end of box #32

Open JasonHorkles opened 8 months ago

JasonHorkles commented 8 months ago

It would be nice if there was an option to change the wrapping so it automatically wraps at the end of the text box without needing a horizontal scroll bar

Tectato commented 8 months ago

This was previously suggested here, but we couldn't figure out how to handle the case where deeply nested parentheses made lines start too far on the right or go off-screen entirely. Would you happen to have an idea for this?

JasonHorkles commented 8 months ago

I'm not sure how the code works exactly but you could do something like if the nesting is greater than x%, don't wrap but rather add the horizonal scroll bar similar to a long string, allowing it to reach further.

Tectato commented 8 months ago

So you're saying keep everything on-screen up until a certain level of indentation, and from there on work as before?

JasonHorkles commented 8 months ago

Mostly - my idea is you have the screen width, and if it needs to extend it further, it adds additional width of the same size as the screen. So if the screen is currently say a size of 300, then it adds another 300 making its width be 600. If it needs even more, it can do so, but it tries to wrap again each time the screen needs to be extended. (I don't imagine it would really need to be extended more than once or twice depending on how much nesting there is)

If you feel this is too complicated though I understand and we can close the issue

Tectato commented 8 months ago

Hm, interesting. I think the issue can stay open for now, but i dont think i'll make this a high priority feature at this time, since i expect this to take a lot of fiddling with thresholds to make it look right and feel intuitive