I played around with the above alias as well. each $wrap() should be returning exactly what would fit within the window. In one instance, I managed to get all 3 (purple, red, and green) to fail at a specific width, having these lines wrap within the window when they shouldn't, as $wrap() should have returned just enough text to fit.

It seems as if the purple line always returns way more text than it should, and always wrapping, but I figured I'd point out a situation where all 3 tests fail at returning a proper chomped line which should fit within the window in one line, without wrapping.

Windows 10 Pro
mIRC 7.63
@Window Font: Lucida Console
@Window FontSize: 12
@Window Width: 317px (window .dw, the text display area, not actual full window .w) (width in which all 3 lines fail)

Commands used:
Initialize: /window -dfe @WrapTest 0 0 308 480
Within the active @Window: /wraptest

This was repeated several times until I hit 352 $window().w (317 $window().dw) then I stopped and echoed out some additional lines about the failure .dw, my font and font size to be included in the screenshot below.

Screenshot showing the failure:

[img]https://ibb.co/ZWCgqmD[/img]

The last 3 colored lines illustrate the failure of returning enough text to just fit.