summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-04-27 23:51:38 +0800
committerptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-04-27 23:51:38 +0800
commit37940e2836260b4b7664f8cae98421a2ed1e312e (patch)
treee136ff48537f4de587ea1ac4e8525ea515a59bd0
parenta3b8cfb9f5e83a3bc36df261d8f083592608554b (diff)
downloadpttbbs-37940e2836260b4b7664f8cae98421a2ed1e312e.tar
pttbbs-37940e2836260b4b7664f8cae98421a2ed1e312e.tar.gz
pttbbs-37940e2836260b4b7664f8cae98421a2ed1e312e.tar.bz2
pttbbs-37940e2836260b4b7664f8cae98421a2ed1e312e.tar.lz
pttbbs-37940e2836260b4b7664f8cae98421a2ed1e312e.tar.xz
pttbbs-37940e2836260b4b7664f8cae98421a2ed1e312e.tar.zst
pttbbs-37940e2836260b4b7664f8cae98421a2ed1e312e.zip
remove the unecessary redraw
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1876 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--include/modes.h1
-rw-r--r--mbbsd/read.c31
2 files changed, 25 insertions, 7 deletions
diff --git a/include/modes.h b/include/modes.h
index cc4e8ad8..4c629f2f 100644
--- a/include/modes.h
+++ b/include/modes.h
@@ -14,6 +14,7 @@
#define PART_REDRAW 10
#define TITLE_REDRAW 11
#define READ_SKIP 12
+#define HEADERS_RELOAD 13
/* user ¾Þ§@ª¬ºA»P¼Ò¦¡ */
#define IDLE 0
diff --git a/mbbsd/read.c b/mbbsd/read.c
index 02f86b08..5fcf885c 100644
--- a/mbbsd/read.c
+++ b/mbbsd/read.c
@@ -229,7 +229,7 @@ fixkeep(char *s, int first)
/* calc cursor pos and show cursor correctly */
static int
-cursor_pos(keeploc_t * locmem, int val, int from_top)
+cursor_pos(keeploc_t * locmem, int val, int from_top, int isshow)
{
int top=locmem->top_ln;
if (!last_line)
@@ -242,16 +242,19 @@ cursor_pos(keeploc_t * locmem, int val, int from_top)
if (val <= 0)
val = 1;
if (val >= top && val < top + p_lines) {
- cursor_clear(3 + locmem->crs_ln - top, 0);
+ if(isshow)
+ {
+ cursor_clear(3 + locmem->crs_ln - top, 0);
+ cursor_show(3 + val - top, 0);
+ }
locmem->crs_ln = val;
- cursor_show(3 + val - top, 0);
return DONOTHING;
}
locmem->top_ln = val - from_top;
if (locmem->top_ln <= 0)
locmem->top_ln = 1;
locmem->crs_ln = val;
- return PARTUPDATE;
+ return isshow ? PARTUPDATE : HEADERS_RELOAD;
}
static int
@@ -415,7 +418,7 @@ i_read_key(onekey_t * rcmdlist, keeploc_t * locmem,
int ch, new_ln= locmem->crs_ln, lastmode=0;
do {
- if((mode=cursor_pos(locmem, new_ln, new_top))!=DONOTHING)
+ if((mode=cursor_pos(locmem, new_ln, new_top, default_ch?0:1))!=DONOTHING)
return mode;
if(default_ch)
@@ -756,7 +759,7 @@ i_read(int cmdmode, char *direct, void (*dotitle) (), void (*doentry) (), onekey
recbase = -1;
}
}
- if (recbase != locmem->top_ln) {
+ if (recbase != locmem->top_ln) { //headers reload
recbase = locmem->top_ln;
if (recbase > last_line) {
recbase = last_line - p_lines + 1;
@@ -785,7 +788,21 @@ i_read(int cmdmode, char *direct, void (*dotitle) (), void (*doentry) (), onekey
break;
case TITLE_REDRAW:
(*dotitle) ();
- break;
+ break;
+
+ case HEADERS_RELOAD:
+ if (recbase != locmem->top_ln) {
+ recbase = locmem->top_ln;
+ if (recbase > last_line) {
+ recbase = last_line - p_lines + 1;
+ if (recbase < 1)
+ recbase = 1;
+ locmem->top_ln = recbase;
+ }
+ entries=get_records_and_bottom(currdirect,
+ headers, recbase, p_lines, last_line, bottom_line);
+ }
+ break;
} //end switch
mode = i_read_key(rcmdlist, locmem, currbid, bottom_line);
} while (mode != DOQUIT);