We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6d6603b commit d3fe652Copy full SHA for d3fe652
packages/render/src/shared/utils/pretty.ts
@@ -185,12 +185,15 @@ export const wrapText = (
185
return `${linePrefix}${text}`;
186
}
187
let wrappedText = linePrefix + text;
188
- let currentLineStartIndex = 0;
+ let currentLineStartIndex = linePrefix.length;
189
while (wrappedText.length - currentLineStartIndex > maxLineLength) {
190
const overflowingCharacterIndex = Math.min(
191
currentLineStartIndex + maxLineLength - 1,
192
wrappedText.length,
193
);
194
+ if (!wrappedText.includes(' ', currentLineStartIndex)) {
195
+ return wrappedText;
196
+ }
197
for (let i = overflowingCharacterIndex; i >= currentLineStartIndex; i--) {
198
const char = wrappedText[i];
199
if (char === ' ') {
0 commit comments