|
|
@ -178,11 +178,19 @@ int main (int argc, char *argv[]) |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
case (KEY_END): |
|
|
|
case (KEY_END): |
|
|
|
t.cur.y = rows.rownum - 1; |
|
|
|
t.cur.x = rows.rw[t.cur.y].size; |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
case (KEY_HOME): |
|
|
|
case (KEY_HOME): |
|
|
|
t.cur.y = 0; |
|
|
|
t.cur.x = 0; |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case (KEY_NPAGE): |
|
|
|
|
|
|
|
t.cur.y += PGK_DELTA; |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case (KEY_PPAGE): |
|
|
|
|
|
|
|
t.cur.y -= PGK_DELTA; |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
case (CTRL('f')): |
|
|
|
case (CTRL('f')): |
|
|
@ -489,7 +497,8 @@ void curUpdateRender () |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
/* Adjust x and y if they are out of bounds */ |
|
|
|
/* Adjust x and y if they are out of bounds */ |
|
|
|
if (t.cur.y < 0 || t.cur.y >= rows.rownum) t.cur.y = 0; |
|
|
|
if (t.cur.y < 0) t.cur.y = 0; |
|
|
|
|
|
|
|
if (t.cur.y >= rows.rownum) t.cur.y = rows.rownum - 1; |
|
|
|
if (t.cur.x < 0) t.cur.x = 0; |
|
|
|
if (t.cur.x < 0) t.cur.x = 0; |
|
|
|
|
|
|
|
|
|
|
|
if (t.cur.y >= t.cur.off_y && t.cur.y < t.cur.off_y + t.dim.y) { |
|
|
|
if (t.cur.y >= t.cur.off_y && t.cur.y < t.cur.off_y + t.dim.y) { |
|
|
|