st/patch/scrollback.c

38 lines
499 B
C
Raw Normal View History

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();
}
}
void
kscrollup(const Arg* a)
{
int n = a->i;
if (n < 0)
n = term.row + n;
if (term.scr <= HISTSIZE-n) {
term.scr += n;
selscroll(0, n);
tfulldirt();
}
}
#if SCROLLBACK_MOUSE_ALTSCREEN_PATCH
int tisaltscr(void)
{
return IS_SET(MODE_ALTSCREEN);
}
#endif // SCROLLBACK_MOUSE_ALTSCREEN_PATCH