From 8e5fa100d37547fbbb2862fe8bab431e0d1ea7a6 Mon Sep 17 00:00:00 2001 From: piaip Date: Sun, 16 Dec 2007 02:51:46 +0000 Subject: - better method to uncache ANSI escapes git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3687 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/screen.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'mbbsd') diff --git a/mbbsd/screen.c b/mbbsd/screen.c index c959cf45..8256ba5e 100644 --- a/mbbsd/screen.c +++ b/mbbsd/screen.c @@ -155,6 +155,8 @@ redoscr(void) oflush(); } +// deprecated? +#if 0 void redoln(void) { @@ -179,6 +181,7 @@ redoln(void) rel_move(tc_col, tc_line, cur_col, cur_ln); oflush(); } +#endif void refresh(void) @@ -213,8 +216,25 @@ refresh(void) j = 0; bp = &big_picture[j]; len = bp->len; - if (bp->mode & MODIFIED && bp->smod < len) { + + if (bp->mode & MODIFIED && bp->smod < len) + { bp->mode &= ~(MODIFIED); + + // more effort to determine ANSI smod + if (bp->smod > 0) + { + int iesc; + for (iesc = bp->smod-1; iesc >= 0; iesc--) + { + if (bp->data[iesc] == ESC_CHR) + { + bp->smod = iesc; + break; + } + } + } + if (bp->emod >= len) bp->emod = len - 1; rel_move(tc_col, tc_line, bp->smod, i); @@ -243,7 +263,6 @@ refresh(void) o_cleol(); } bp->oldlen = len; - } rel_move(tc_col, tc_line, cur_col, cur_ln); -- cgit v1.2.3