okai 0.0.17 → 0.0.19
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/index.js +15 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -474,7 +474,7 @@ async function createGistPreview(title, gist) {
|
|
474
474
|
style: {
|
475
475
|
selected: {
|
476
476
|
bg: 'blue',
|
477
|
-
fg: '
|
477
|
+
fg: 'black'
|
478
478
|
}
|
479
479
|
},
|
480
480
|
keys: true,
|
@@ -507,7 +507,7 @@ async function createGistPreview(title, gist) {
|
|
507
507
|
height: 1,
|
508
508
|
content: 'Press (a) accept (q) quit',
|
509
509
|
style: {
|
510
|
-
fg: '
|
510
|
+
fg: 'black',
|
511
511
|
bg: 'blue'
|
512
512
|
}
|
513
513
|
});
|
@@ -547,13 +547,25 @@ async function createGistPreview(title, gist) {
|
|
547
547
|
// Page Down handler
|
548
548
|
if (key.name === 'pagedown') {
|
549
549
|
// Calculate max scroll position to prevent scrolling beyond content
|
550
|
-
const maxScroll = Math.max(0, contentHeight - boxHeight +
|
550
|
+
const maxScroll = Math.max(0, contentHeight - boxHeight + 2);
|
551
551
|
// Calculate new scroll position, ensuring it doesn't exceed max
|
552
552
|
const newScrollPosition = Math.min(maxScroll, currentScroll + scrollAmount);
|
553
553
|
preview.setScroll(newScrollPosition);
|
554
554
|
// titleBar.setContent(`DOWN ${maxScroll} = ${contentHeight} - ${boxHeight}; min(${maxScroll}, ${currentScroll} + ${scrollAmount}) => ${newScrollPosition}`)
|
555
555
|
screen.render();
|
556
556
|
}
|
557
|
+
// Home key handler (scroll to top)
|
558
|
+
if (key.name === 'home') {
|
559
|
+
preview.setScroll(0);
|
560
|
+
screen.render();
|
561
|
+
}
|
562
|
+
// End key handler (scroll to bottom)
|
563
|
+
if (key.name === 'end') {
|
564
|
+
// Calculate max scroll position to show last page of content
|
565
|
+
const maxScroll = Math.max(0, contentHeight - boxHeight + 2);
|
566
|
+
preview.setScroll(maxScroll);
|
567
|
+
screen.render();
|
568
|
+
}
|
557
569
|
});
|
558
570
|
// Handle key events
|
559
571
|
screen.key(['q', 'C-c'], () => process.exit(0));
|