rlm-cli 0.2.23 → 0.2.25
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/viewer.js +15 -14
- package/package.json +1 -1
package/dist/viewer.js
CHANGED
|
@@ -336,16 +336,18 @@ function renderIteration(state) {
|
|
|
336
336
|
if (state.scrollY < 0)
|
|
337
337
|
state.scrollY = 0;
|
|
338
338
|
const from = state.scrollY;
|
|
339
|
-
|
|
339
|
+
// Reserve lines for scroll indicators when needed
|
|
340
|
+
const hasScrollUp = from > 0;
|
|
341
|
+
const hasScrollDown = (from + viewable) < allLines.length;
|
|
342
|
+
const contentLines = viewable - (hasScrollUp ? 1 : 0) - (hasScrollDown ? 1 : 0);
|
|
343
|
+
const to = Math.min(allLines.length, from + contentLines);
|
|
340
344
|
W(c.cursorHome, c.clearScreen, c.hideCursor);
|
|
341
|
-
|
|
342
|
-
if (from > 0) {
|
|
345
|
+
if (hasScrollUp) {
|
|
343
346
|
W(` ${c.dim}^ scroll up (${from} lines above)${c.reset}\n`);
|
|
344
347
|
}
|
|
345
348
|
for (let i = from; i < to; i++)
|
|
346
349
|
W(allLines[i] + "\n");
|
|
347
|
-
if (
|
|
348
|
-
// Replace last visible line with scroll indicator
|
|
350
|
+
if (hasScrollDown) {
|
|
349
351
|
W(` ${c.dim}v scroll down (${allLines.length - to} lines below)${c.reset}\n`);
|
|
350
352
|
}
|
|
351
353
|
// Footer
|
|
@@ -517,18 +519,17 @@ function renderSubQueryDetail(state) {
|
|
|
517
519
|
if (state.scrollY < 0)
|
|
518
520
|
state.scrollY = 0;
|
|
519
521
|
const from = state.scrollY;
|
|
520
|
-
const
|
|
522
|
+
const hasScrollUp = from > 0;
|
|
523
|
+
const hasScrollDown = (from + viewable) < allLines.length;
|
|
524
|
+
const contentLines = viewable - (hasScrollUp ? 1 : 0) - (hasScrollDown ? 1 : 0);
|
|
525
|
+
const to = Math.min(allLines.length, from + contentLines);
|
|
521
526
|
W(c.cursorHome, c.clearScreen, c.hideCursor);
|
|
522
|
-
if (
|
|
527
|
+
if (hasScrollUp) {
|
|
523
528
|
W(` ${c.dim}^ scroll up (${from} lines above)${c.reset}\n`);
|
|
524
|
-
for (let i = from + 1; i < to; i++)
|
|
525
|
-
W(allLines[i] + "\n");
|
|
526
529
|
}
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
}
|
|
531
|
-
if (to < allLines.length) {
|
|
530
|
+
for (let i = from; i < to; i++)
|
|
531
|
+
W(allLines[i] + "\n");
|
|
532
|
+
if (hasScrollDown) {
|
|
532
533
|
W(` ${c.dim}v scroll down (${allLines.length - to} lines below)${c.reset}\n`);
|
|
533
534
|
}
|
|
534
535
|
// Footer
|