diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2009-05-23 02:54:24 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2009-05-23 02:54:24 +0800 |
commit | 80d2d9d294bbbc20c27cbe2f8f604854e9c4a045 (patch) | |
tree | 68e1c5daf75beaabebb506f04712b55957eb811f /mbbsd/edit.c | |
parent | bc099167f04193048ca97e7d94f3f47b434852a2 (diff) | |
download | pttbbs-80d2d9d294bbbc20c27cbe2f8f604854e9c4a045.tar pttbbs-80d2d9d294bbbc20c27cbe2f8f604854e9c4a045.tar.gz pttbbs-80d2d9d294bbbc20c27cbe2f8f604854e9c4a045.tar.bz2 pttbbs-80d2d9d294bbbc20c27cbe2f8f604854e9c4a045.tar.lz pttbbs-80d2d9d294bbbc20c27cbe2f8f604854e9c4a045.tar.xz pttbbs-80d2d9d294bbbc20c27cbe2f8f604854e9c4a045.tar.zst pttbbs-80d2d9d294bbbc20c27cbe2f8f604854e9c4a045.zip |
- improve pmore movie syntax highlight
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4458 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/edit.c')
-rw-r--r-- | mbbsd/edit.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/mbbsd/edit.c b/mbbsd/edit.c index a94190ff..89a1e729 100644 --- a/mbbsd/edit.c +++ b/mbbsd/edit.c @@ -2278,6 +2278,7 @@ void syn_pmore_render(char *os, int len, char *buf) char *s = (char *)mf_movieFrameHeader((unsigned char*)os, (unsigned char*)os + len); char attr = 1; char iname = 0; + char prefix = 0; memset(buf, 0, len); if (!len || !s) return; @@ -2334,23 +2335,26 @@ void syn_pmore_render(char *os, int len, char *buf) attr++; continue; + case 'I': case 'G': iname = 0; *buf++ = attr++; - while (len >0 && + prefix = 1; + while (len > 0 && ( (isascii(*s) && isalnum(*s)) || strchr("+-:lpf,", *s)) ) { - if (*s == ':') + if (prefix) { - if (++iname % 2) - attr ++; + if (!strchr(":lpf", *s)) + break; + prefix = 0; } *buf++ = attr; - if (*s == ',') attr++; - if (*s == ':' && !(iname%2) ) + if (*s == ',') { - attr--; + attr++; + prefix = 1; } s++; len--; } |