Releases: demonnic/fText
Fixed wordwrapping with embedded colour codes
This release only really brings a few small changes, but the main important one is with word wrapping. Word wrapping used by fText and all its derivatives will now properly wrap items with embedded colour codes, based on the formatType option. For example, the current behaviour looks like so (I apologize in advance for the colours used):
Word wrapping against the base string, without any color codes in it:
And the newly fixed word wrapping for coloured text:
You can use demonnic.xwrap(str, width, type) to wordwrap your coloured text. If you want to wordwrap text for cecho, use 'c' for type, 'd' for decho and 'h' for hecho. If you pass anything else, or do not pass a type, then it will wordwrap using the old demonnic.wordWrap function, which words great for uncoloured text.
Also, if you were using demonnic.wordWrap directly yourself, you were likely using it as demonnic:wordWrap(str, width) ... but you should change that to demonnic.wordWrap rather than demonnic:wordWrap.
In which I fix a gigantic bug
For real, anything aligned left or right was 1 character short. I don't know how I missed this and how it wasn't reported, but while I was writing tests for fText it became glaringly obvious.
demonnic.fText now has 16 tests for me to run against it when making changes to make sure I didn't break anything. I'll get them included in the source code soon but this should make future changes easier.
1.2.0 now with echoLink and echoPopup support baked in
Here's a brief demo video of the echoLink and echoPopup functionality: https://youtu.be/_XnaJlkI7WM