Mercurial > hg > nnchat
comparison nnchat.c @ 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 |
comparison
equal
deleted
inserted
replaced
322:b9c15c57dc8f | 323:863e3a26974d |
---|---|
1748 { | 1748 { |
1749 int numLines, numCols, oldPos = currWin->pos; | 1749 int numLines, numCols, oldPos = currWin->pos; |
1750 getmaxyx(mainWin, numLines, numCols); | 1750 getmaxyx(mainWin, numLines, numCols); |
1751 numLines = (numLines / 2) + 1; | 1751 numLines = (numLines / 2) + 1; |
1752 | 1752 |
1753 if (c == KEY_PPAGE) | 1753 if (c == KEY_PPAGE) { |
1754 currWin->pos = (currWin->pos > numLines) ? currWin->pos - numLines : 0; | 1754 if (currWin->pos > 10) |
1755 else | 1755 currWin->pos -= 10; |
1756 currWin->pos = (currWin->pos < currWin->data->n - numLines) ? currWin->pos + numLines : currWin->data->n - numLines; | 1756 else |
1757 currWin->pos = 0; | |
1758 } | |
1759 else { | |
1760 if (currWin->pos < currWin->data->size - 10) | |
1761 currWin->pos += 10; | |
1762 else | |
1763 currWin->pos = currWin->data->size - 10; | |
1764 } | |
1757 | 1765 |
1758 if (oldPos != currWin->pos) | 1766 if (oldPos != currWin->pos) |
1759 updateMain = TRUE; | 1767 updateMain = TRUE; |
1760 } | 1768 } |
1761 break; | 1769 break; |