syntax_color: apply string syntax color prior to others.
even if the comments are inside of the qutoes, the comments syntax color should not be applied.
This commit is contained in:
parent
6b6f4b19c1
commit
d2e3c6dc6b
|
@ -860,6 +860,20 @@ color_apply(color_data *cd, const char *src, int length, char *from, char *to)
|
|||
}
|
||||
}
|
||||
|
||||
//escape string: " ~ "
|
||||
ret = string_apply(strbuf, &cur, &prev, cd->col_string, inside_string);
|
||||
if (ret == 1)
|
||||
{
|
||||
inside_string = !inside_string;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (inside_string || inside_comment)
|
||||
{
|
||||
cur++;
|
||||
continue;
|
||||
}
|
||||
|
||||
//handle comment: /* ~ */
|
||||
ret = comment_apply(strbuf, &src, length, &cur, &prev, cd->col_comment,
|
||||
&inside_comment);
|
||||
|
@ -875,20 +889,6 @@ color_apply(color_data *cd, const char *src, int length, char *from, char *to)
|
|||
else if (ret == -1) goto finished;
|
||||
}
|
||||
|
||||
//escape string: " ~ "
|
||||
ret = string_apply(strbuf, &cur, &prev, cd->col_string, inside_string);
|
||||
if (ret == 1)
|
||||
{
|
||||
inside_string = !inside_string;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (inside_string || inside_comment)
|
||||
{
|
||||
cur++;
|
||||
continue;
|
||||
}
|
||||
|
||||
//handle comment: preprocessors, #
|
||||
ret = macro_apply(strbuf, &src, length, &cur, &prev, cd->col_macro, cd);
|
||||
if (ret == 1) continue;
|
||||
|
|
Loading…
Reference in New Issue