From: ewt Date: Thu, 6 Aug 1998 14:24:50 +0000 (+0000) Subject: handle pgdn in short textboxes properly X-Git-Tag: r0-30~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d3c093618bc9ddca8ad2e36af0e3369ea5e1471a;p=thirdparty%2Fnewt.git handle pgdn in short textboxes properly --- diff --git a/textbox.c b/textbox.c index 1f0159d..db42d95 100644 --- 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;