]> git.ipfire.org Git - thirdparty/newt.git/commitdiff
handle pgdn in short textboxes properly
authorewt <ewt>
Thu, 6 Aug 1998 14:24:50 +0000 (14:24 +0000)
committerewt <ewt>
Thu, 6 Aug 1998 14:24:50 +0000 (14:24 +0000)
textbox.c

index 1f0159d9519dd6084e40f07a069574ba5e0acd4d..db42d955bbe4b1e97d4ac12878ef9b183c5a1a70 100644 (file)
--- a/textbox.c
+++ b/textbox.c
@@ -323,8 +323,10 @@ static struct eventResult textboxEvent(newtComponent co,
 
          case NEWT_KEY_PGDN:
            tb->topLine += co->height;
-           if (tb->topLine > (tb->numLines - co->height))
+           if (tb->topLine > (tb->numLines - co->height)) {
                tb->topLine = tb->numLines - co->height;
+               if (tb->topLine < 0) tb->topLine = 0;
+           }
            textboxDraw(co);
            er.result = ER_SWALLOWED;
            break;