@rohal12/spindle 0.60.2 → 0.60.3
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.
|
@@ -13986,7 +13986,8 @@ function wordWrap(text, maxLen, indent) {
|
|
|
13986
13986
|
if (token.type === "text" || token.type === "html") continue;
|
|
13987
13987
|
inToken.fill(true, token.start, token.end);
|
|
13988
13988
|
}
|
|
13989
|
-
const room = maxLen - indent
|
|
13989
|
+
const room = maxLen - indentColumn(indent);
|
|
13990
|
+
if (room <= 0) return [indent + text];
|
|
13990
13991
|
let pos = 0;
|
|
13991
13992
|
while (pos < text.length) {
|
|
13992
13993
|
if (text.length - pos <= room) {
|
package/package.json
CHANGED
|
@@ -587,7 +587,9 @@ function wordWrap(text: string, maxLen: number, indent: string): string[] {
|
|
|
587
587
|
if (token.type === 'text' || token.type === 'html') continue;
|
|
588
588
|
inToken.fill(true, token.start, token.end);
|
|
589
589
|
}
|
|
590
|
-
const room = maxLen - indent
|
|
590
|
+
const room = maxLen - indentColumn(indent);
|
|
591
|
+
// With no room after the prefix, keep the line instead of searching before pos.
|
|
592
|
+
if (room <= 0) return [indent + text];
|
|
591
593
|
let pos = 0;
|
|
592
594
|
|
|
593
595
|
while (pos < text.length) {
|