Commit: 9cd994eee2ed8eddabc4a9d9a2dc69f5df404207
Parent: 95d07bd283696802a11d54d6fac625696e70fd1a
Author: Randy Palamar
Date: Tue, 20 Aug 2024 09:24:16 -0600
scroll: do nothing when there aren't backlog lines
Diffstat:
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/vtgl.c b/vtgl.c
@@ -315,6 +315,10 @@ KEYBIND_FN(scroll)
TermView *tv = t->views + t->view_idx;
+ /* NOTE: do nothing if there aren't enough lines to scrollback */
+ if (tv->lines.filled < t->size.h)
+ return 1;
+
t->scroll_offset += a.i;
CLAMP(t->scroll_offset, 0, tv->lines.filled - (t->size.h - 1));