scrollback: do not scroll up when already at the top ref. #57

This commit is contained in:
bakkeby 2022-03-06 12:30:56 +01:00
parent 4a156b95f9
commit 51dc6ba469
2 changed files with 6 additions and 5 deletions

View file

@ -26,6 +26,11 @@ kscrollup(const Arg* a)
int n = a->i;
if (n < 0)
n = term.row + n;
if (term.scr + n > term.histi)
n = term.histi - term.scr;
if (!n)
return;
if (term.scr <= HISTSIZE-n) {
term.scr += n;