clamp scroll

This commit is contained in:
Your Name
2025-09-29 21:49:09 -06:00
parent d9ed0f2a93
commit 0b9c16a378

3
st.c
View File

@@ -1091,6 +1091,9 @@ void
kscrollup(const Arg* a) kscrollup(const Arg* a)
{ {
int n = a->i; int n = a->i;
int maxup = term.histi - term.scr;
if (maxup <= 0) return;
if (n > maxup) n = maxup;
if (n < 0) if (n < 0)
n = term.row + n; n = term.row + n;