comparison nnchat.c @ 331:26097c5b9b71

Change how backbuffer offset is handled.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 14 Jun 2011 17:02:12 +0300
parents 8e509d6546d3
children f55f8309aa66
comparison
equal deleted inserted replaced
330:8e509d6546d3 331:26097c5b9b71
1729 /* Page Up / Page Down */ 1729 /* Page Up / Page Down */
1730 if (currWin != NULL) 1730 if (currWin != NULL)
1731 { 1731 {
1732 int oldPos = currWin->pos; 1732 int oldPos = currWin->pos;
1733 1733
1734 if (c == KEY_NPAGE) { 1734 currWin->pos += (c == KEY_NPAGE) ? -10 : +10;
1735 if (currWin->pos > -10) 1735
1736 currWin->pos -= 10; 1736 if (currWin->pos < 0)
1737 else 1737 currWin->pos = 0;
1738 currWin->pos = -10; 1738 else if (currWin->pos >= currWin->data->n - 10)
1739 } 1739 currWin->pos = currWin->data->n - 10;
1740 else {
1741 if (currWin->pos < currWin->data->n - 10)
1742 currWin->pos += 10;
1743 else
1744 currWin->pos = currWin->data->n - 10;
1745 }
1746 1740
1747 if (oldPos != currWin->pos) 1741 if (oldPos != currWin->pos)
1748 updateMain = TRUE; 1742 updateMain = TRUE;
1749 } 1743 }
1750 break; 1744 break;