Mercurial > hg > nnchat
changeset 323:863e3a26974d
Twiddling with the PGUP / PGDN logic.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sat, 11 Jun 2011 09:49:05 +0300 |
parents | b9c15c57dc8f |
children | ba4cc7ebe311 |
files | nnchat.c |
diffstat | 1 files changed, 12 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/nnchat.c Sat Jun 11 09:48:26 2011 +0300 +++ b/nnchat.c Sat Jun 11 09:49:05 2011 +0300 @@ -1750,10 +1750,18 @@ getmaxyx(mainWin, numLines, numCols); numLines = (numLines / 2) + 1; - if (c == KEY_PPAGE) - currWin->pos = (currWin->pos > numLines) ? currWin->pos - numLines : 0; - else - currWin->pos = (currWin->pos < currWin->data->n - numLines) ? currWin->pos + numLines : currWin->data->n - numLines; + if (c == KEY_PPAGE) { + if (currWin->pos > 10) + currWin->pos -= 10; + else + currWin->pos = 0; + } + else { + if (currWin->pos < currWin->data->size - 10) + currWin->pos += 10; + else + currWin->pos = currWin->data->size - 10; + } if (oldPos != currWin->pos) updateMain = TRUE;