diff --git a/st.c b/st.c index 71cf11a..f502b5c 100644 --- a/st.c +++ b/st.c @@ -1091,6 +1091,9 @@ void kscrollup(const Arg* a) { int n = a->i; + int maxup = term.histi - term.scr; + if (maxup <= 0) return; + if (n > maxup) n = maxup; if (n < 0) n = term.row + n;