@oh-my-pi/pi-tui 3.31.0 → 3.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/utils.ts +12 -0
package/package.json
CHANGED
package/src/utils.ts
CHANGED
|
@@ -474,6 +474,18 @@ function wrapSingleLine(line: string, width: number): string[] {
|
|
|
474
474
|
const isWhitespace = token.trim() === "";
|
|
475
475
|
|
|
476
476
|
// Token itself is too long - break it character by character
|
|
477
|
+
// For whitespace tokens exceeding width, truncate to width instead of breaking
|
|
478
|
+
if (tokenVisibleLength > width && isWhitespace) {
|
|
479
|
+
// Truncate long whitespace to fit width
|
|
480
|
+
const truncated = token.substring(0, width - currentVisibleLength);
|
|
481
|
+
if (truncated) {
|
|
482
|
+
currentLine += truncated;
|
|
483
|
+
currentVisibleLength += visibleWidth(truncated);
|
|
484
|
+
}
|
|
485
|
+
updateTrackerFromText(token, tracker);
|
|
486
|
+
continue;
|
|
487
|
+
}
|
|
488
|
+
|
|
477
489
|
if (tokenVisibleLength > width && !isWhitespace) {
|
|
478
490
|
if (currentLine) {
|
|
479
491
|
// Add specific reset for underline only (preserves background)
|