Adding scrollback patch

This commit is contained in:
bakkeby 2019-09-16 15:31:58 +02:00
parent 4bd0ed3327
commit d52c5e4ce8
9 changed files with 302 additions and 3 deletions

38
patch/scrollback.c Normal file
View file

@ -0,0 +1,38 @@
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