From 98e34e734e91e8d1c982aa0674faf9f7bcb4e991 Mon Sep 17 00:00:00 2001 From: piaip Date: Fri, 22 May 2009 19:43:28 +0000 Subject: refine pmore movie syntax highlight, again git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4460 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/edit.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/mbbsd/edit.c b/mbbsd/edit.c index 89a1e729..d2bc6d08 100644 --- a/mbbsd/edit.c +++ b/mbbsd/edit.c @@ -2314,11 +2314,11 @@ void syn_pmore_render(char *os, int len, char *buf) return; case '#': - *buf++ = attr; + *buf++ = attr++; while (len > 0) { - if (*s == '#') attr++; *buf++ = attr; + if (*s == '#') attr++; len--; s++; } return; @@ -2342,7 +2342,7 @@ void syn_pmore_render(char *os, int len, char *buf) prefix = 1; while (len > 0 && ( (isascii(*s) && isalnum(*s)) || - strchr("+-:lpf,", *s)) ) + strchr("+-,:lpf", *s)) ) { if (prefix) { @@ -2603,11 +2603,10 @@ edit_outs_attr_n(const char *text, int n, int attr) // only render when attribute was changed. if (mattr != *pmattr) { - mattr = *pmattr; - if (mattr) + if (*pmattr) { prints(ANSI_COLOR(1;3%d), - (mattr % 7) +1); + 8 - ((mattr-1) % 7+1) ); } else { outs(ANSI_RESET); } -- cgit v1.2.3