diff options
Diffstat (limited to 'source/blender/editors/space_text/text_format_osl.c')
-rw-r--r-- | source/blender/editors/space_text/text_format_osl.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/editors/space_text/text_format_osl.c b/source/blender/editors/space_text/text_format_osl.c index 26bb5f66cef..7d493eb1f62 100644 --- a/source/blender/editors/space_text/text_format_osl.c +++ b/source/blender/editors/space_text/text_format_osl.c @@ -295,7 +295,12 @@ static void txtfmt_osl_format_line(SpaceText *st, TextLine *line, const int do_n else if ((i = txtfmt_osl_find_preprocessor(str)) != -1) prev = FMT_TYPE_DIRECTIVE; if (i > 0) { - text_format_fill(&str, &fmt, prev, i); + if (prev == FMT_TYPE_DIRECTIVE) { /* can contain utf8 */ + text_format_fill(&str, &fmt, prev, i); + } + else { + text_format_fill_ascii(&str, &fmt, prev, i); + } } else { str += BLI_str_utf8_size_safe(str) - 1; |