@taj-special/dravix-code 1.2.2 → 1.2.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.
- package/dist/cli/repl.js +22 -1
- package/package.json +1 -1
package/dist/cli/repl.js
CHANGED
|
@@ -402,7 +402,28 @@ class MarkdownRenderer {
|
|
|
402
402
|
return ' ' + colors.dim('─'.repeat(Math.min((process.stdout.columns ?? 80) - 4, 72))) + '\n';
|
|
403
403
|
}
|
|
404
404
|
// ── Normal text ───────────────────────────────────────────
|
|
405
|
-
|
|
405
|
+
// Wrap text before right edge, but with minimal margin
|
|
406
|
+
const termWidth = process.stdout.columns ?? 80;
|
|
407
|
+
const maxTextWidth = termWidth - 1; // just 1 char from right edge
|
|
408
|
+
const rawText = applyInline(raw);
|
|
409
|
+
if (rawText.length > maxTextWidth) {
|
|
410
|
+
// Word-wrap at spaces, keeping lines close to edge
|
|
411
|
+
const words = rawText.split(' ');
|
|
412
|
+
let line = '';
|
|
413
|
+
let result = ' ';
|
|
414
|
+
for (const word of words) {
|
|
415
|
+
if (line.length + word.length + 1 > maxTextWidth && line.length > 0) {
|
|
416
|
+
result += line.trimEnd() + '\n ';
|
|
417
|
+
line = word + ' ';
|
|
418
|
+
}
|
|
419
|
+
else {
|
|
420
|
+
line += word + ' ';
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
result += line.trimEnd();
|
|
424
|
+
return colors.ai(result) + '\n';
|
|
425
|
+
}
|
|
426
|
+
return ' ' + colors.ai(rawText) + '\n';
|
|
406
427
|
}
|
|
407
428
|
renderTable() {
|
|
408
429
|
const rows = this.tableRows;
|