dunbarx wrote: ↑Sat Feb 16, 2019 5:57 pm
This has been a subject of discussion forever, that a space, and not simply the width of a field, determines wrapping. There are a bunch of kluges using the formattedWidth, formattedText and actual text properties to be able to force line wrapping in unspaced text.
Yah, I can believe it. I was a bit surprised that this was the default behavior, but probably shouldn't have been
It is probably the languages I come from that keeps fouling me up in this one. Delphi, for instance, wrapped based on a number of delimiters, just as Lazarus/FPC does ~

- Lazarus/FPC IDE word wrapping...
I wound up just setting a scrollbar if the formatted width exceeds the text area. I expected to have to do that for the height anyway, but for expediency went with the width as well.
FourthWorld wrote: ↑Sat Feb 16, 2019 9:37 pm
So the issue tends to come up when displaying things that aren't readable text, which raises the question: if it's not for reading, why bother putting it into a field?
Well, like everything, there are the 'exceptions to the rule...', and this case is no different. Inspired by one of
your posts to more fully explore creating text editors, I was testing opening different files. In this case, the file had an extremely long URL in it, which of course has no spaces, but is certainly readable and may even be desirable to read.
Other languages I am more used to handle this differently than Lc does (as mentioned above), but even common text editors tend to handle it the same way. Here is a shot of the project in Lc, vs. the file in Pluma ~

- I ain't no wrapper!
As you can see, Pluma, much like the Laz IDE, tends to wrap based on whatever it determines to be a reasonable delimiter, in this case, it wraps at the '/', but it will also wrap at other things, such as a '-' or space or even a '\' but not, suprisingly, a period if no space is on the other side
In Pluma, though, it isn't going to just wrap no matter what, if you have a single line of characters with no interruption, it will do as Lc does, and introduce a scrollbar. That is, as I said, behavior I think of as 'normal' or 'expected'.
Ultimately, my question was more towards my education than needing a solution, as Craig mentions there are a hundred ways to handle it. I'm not sure I'd call them kludges though, as the ones that come to the top of my head are legitimate uses of the language. I guess I just expected the most common ones to be 'baked in'
