2019-09-16 15:31:58 +02:00
|
|
|
void
|
|
|
|
kscrolldown(const Arg* a)
|
|
|
|
{
|
|
|
|
int n = a->i;
|
|
|
|
|
|
|
|
if (n < 0)
|
|
|
|
n = term.row + n;
|
|
|
|
|
|
|
|
if (n > term.scr)
|
|
|
|
n = term.scr;
|
|
|
|
|
|
|
|
if (term.scr > 0) {
|
|
|
|
term.scr -= n;
|
|
|
|
selscroll(0, -n);
|
|
|
|
tfulldirt();
|
|
|
|
}
|
2021-07-07 09:43:43 +02:00
|
|
|
|
|
|
|
#if SIXEL_PATCH
|
|
|
|
scroll_images(-1*n);
|
|
|
|
#endif // SIXEL_PATCH
|
2019-09-16 15:31:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
kscrollup(const Arg* a)
|
|
|
|
{
|
|
|
|
int n = a->i;
|
|
|
|
if (n < 0)
|
|
|
|
n = term.row + n;
|
2022-07-01 13:59:03 +02:00
|
|
|
|
|
|
|
if (term.scr + n > term.histn)
|
|
|
|
n = term.histn - term.scr;
|
2022-03-06 12:30:56 +01:00
|
|
|
|
|
|
|
if (!n)
|
|
|
|
return;
|
2019-09-16 15:31:58 +02:00
|
|
|
|
|
|
|
if (term.scr <= HISTSIZE-n) {
|
|
|
|
term.scr += n;
|
|
|
|
selscroll(0, n);
|
|
|
|
tfulldirt();
|
|
|
|
}
|
2021-07-07 09:43:43 +02:00
|
|
|
|
|
|
|
#if SIXEL_PATCH
|
|
|
|
scroll_images(n);
|
|
|
|
#endif // SIXEL_PATCH
|
2019-09-16 15:31:58 +02:00
|
|
|
}
|