Archived
0
0
Fork 0
This repository has been archived on 2024-02-06. You can view files and clone it, but cannot push or open issues or pull requests.
dotfiles/suckless/st/patch/scrollback.c

42 lines
488 B
C
Raw Normal View History

2021-12-28 05:04:49 +00: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();
}
scroll_images(-1*n);
}
void
kscrollup(const Arg* a)
{
int n = a->i;
if (n < 0)
n = term.row + n;
2022-07-17 04:28:15 +00:00
if (term.scr + n > term.histi)
n = term.histi - term.scr;
if (!n)
return;
2021-12-28 05:04:49 +00:00
if (term.scr <= HISTSIZE-n) {
term.scr += n;
selscroll(0, n);
tfulldirt();
}
scroll_images(n);
}