From 7fb4d7c51f5a7177d8f38a4956f40a2ed1fa199e Mon Sep 17 00:00:00 2001 From: ptt Date: Tue, 27 Apr 2004 13:55:39 +0000 Subject: hobit problem fixed cursor position git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1873 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/read.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'mbbsd') diff --git a/mbbsd/read.c b/mbbsd/read.c index 7737f632..b2f001d0 100644 --- a/mbbsd/read.c +++ b/mbbsd/read.c @@ -409,18 +409,20 @@ i_read_key(onekey_t * rcmdlist, keeploc_t * locmem, int bid, int bottom_line) { int mode = DONOTHING; - int num; + int num, new_top=10; char direct[60]; static char default_ch=0; int ch, new_ln= locmem->crs_ln, lastmode=0; do { - if((mode=cursor_pos(locmem, new_ln, 10))!=DONOTHING) + if((mode=cursor_pos(locmem, new_ln, new_top))!=DONOTHING) return mode; if(default_ch) ch = default_ch; else ch = igetch(); + + new_top = 10; // default 10 switch (ch) { case '0': case '1': @@ -505,11 +507,13 @@ i_read_key(onekey_t * rcmdlist, keeploc_t * locmem, case 'k': case KEY_UP: new_ln = locmem->crs_ln - 1; + new_top = p_lines - 2; break; case 'n': case 'j': case KEY_DOWN: new_ln = locmem->crs_ln + 1; + new_top = 1; break; case ' ': case KEY_PGDN: @@ -525,6 +529,7 @@ i_read_key(onekey_t * rcmdlist, keeploc_t * locmem, case KEY_END: case '$': new_ln = last_line; + new_top = p_lines-1; break; case 'F': case 'U': -- cgit v1.2.3