Adding scrollback patch
This commit is contained in:
parent
4bd0ed3327
commit
d52c5e4ce8
9 changed files with 302 additions and 3 deletions
38
patch/scrollback.c
Normal file
38
patch/scrollback.c
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue