summaryrefslogtreecommitdiffstats
path: root/mbbsd/screen.c
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2007-12-16 10:51:46 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2007-12-16 10:51:46 +0800
commit8e5fa100d37547fbbb2862fe8bab431e0d1ea7a6 (patch)
tree28ba9c94c2344d11e8c910302f1ff63193f6ca6f /mbbsd/screen.c
parent2ffc08bb0498d5f15af3a3e0118df3f70d96a939 (diff)
downloadpttbbs-8e5fa100d37547fbbb2862fe8bab431e0d1ea7a6.tar
pttbbs-8e5fa100d37547fbbb2862fe8bab431e0d1ea7a6.tar.gz
pttbbs-8e5fa100d37547fbbb2862fe8bab431e0d1ea7a6.tar.bz2
pttbbs-8e5fa100d37547fbbb2862fe8bab431e0d1ea7a6.tar.lz
pttbbs-8e5fa100d37547fbbb2862fe8bab431e0d1ea7a6.tar.xz
pttbbs-8e5fa100d37547fbbb2862fe8bab431e0d1ea7a6.tar.zst
pttbbs-8e5fa100d37547fbbb2862fe8bab431e0d1ea7a6.zip
- better method to uncache ANSI escapes
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3687 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/screen.c')
-rw-r--r--mbbsd/screen.c23
1 files changed, 21 insertions, 2 deletions
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);