syntax_color: reorder the syntax color.

apply comments color prior to tags.
This commit is contained in:
ChunEon Park 2015-07-09 22:48:16 +09:00
parent 6e911ef3fc
commit 74ff6efbd7
1 changed files with 15 additions and 15 deletions

View File

@ -893,6 +893,21 @@ color_apply(color_data *cd, const char *src, int length, char *from, char *to)
continue;
}
//handle comment: /* ~ */
ret = comment_apply(strbuf, &src, length, &cur, &prev, cd->col_comment,
&inside_comment);
if (ret == 1) continue;
else if (ret == -1) goto finished;
//handle comment: //
if (!from || (cur >= from))
{
ret = comment2_apply(strbuf, &src, length, &cur, &prev,
cd->col_comment, &inside_comment);
if (ret == 1) continue;
else if (ret == -1) goto finished;
}
if (*cur == '<')
{
//escape EOL: <br/>
@ -910,21 +925,6 @@ color_apply(color_data *cd, const char *src, int length, char *from, char *to)
}
}
//handle comment: /* ~ */
ret = comment_apply(strbuf, &src, length, &cur, &prev, cd->col_comment,
&inside_comment);
if (ret == 1) continue;
else if (ret == -1) goto finished;
//handle comment: //
if (!from || (cur >= from))
{
ret = comment2_apply(strbuf, &src, length, &cur, &prev,
cd->col_comment, &inside_comment);
if (ret == 1) continue;
else if (ret == -1) goto finished;
}
//handle comment: preprocessors, #
ret = macro_apply(strbuf, &src, length, &cur, &prev, cd->col_macro, cd);
if (ret == 1) continue;