From e12354c4c5850864f925d22f53ec31578384bc63 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 30 Dec 2012 01:26:31 +0000 Subject: add syntax highlighting color for symbols --- source/blender/editors/space_text/text_draw.c | 2 +- .../blender/editors/space_text/text_format_osl.c | 22 ++-------------------- source/blender/editors/space_text/text_format_py.c | 4 ++-- 3 files changed, 5 insertions(+), 23 deletions(-) (limited to 'source/blender/editors/space_text') diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c index 01adf6a4107..2256c1c7e25 100644 --- a/source/blender/editors/space_text/text_draw.c +++ b/source/blender/editors/space_text/text_draw.c @@ -120,7 +120,7 @@ static void format_draw_color(char formatchar) case FMT_TYPE_WHITESPACE: break; case FMT_TYPE_SYMBOL: - UI_ThemeColorBlend(TH_TEXT, TH_BACK, 0.5f); + UI_ThemeColor(TH_SYNTAX_S); break; case FMT_TYPE_COMMENT: UI_ThemeColor(TH_SYNTAX_C); diff --git a/source/blender/editors/space_text/text_format_osl.c b/source/blender/editors/space_text/text_format_osl.c index 433ff0a035b..38903d65ec0 100644 --- a/source/blender/editors/space_text/text_format_osl.c +++ b/source/blender/editors/space_text/text_format_osl.c @@ -154,8 +154,8 @@ static int txtfmt_osl_find_preprocessor(const char *string) { if (string[0] == '#') { int i = 1; - /* whitespace is ok '# foo' */ - while (string[i] == '\t' || string[i] == ' ') { + /* Whitespace is ok '# foo' */ + while (text_check_whitespace(string[i])) { i++; } while (text_check_identifier(string[i])) { @@ -166,24 +166,6 @@ static int txtfmt_osl_find_preprocessor(const char *string) return -1; } -/* not in OSL, keep for now though */ -#if 0 -static int txtfmt_osl_find_bool(const char *string) -{ - int i, len; - - if (STR_LITERAL_STARTSWITH(string, "None", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "True", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "False", len)) i = len; - else i = 0; - - /* If next source char is an identifier (eg. 'i' in "Nonetheless") no match */ - if (i == 0 || text_check_identifier(string[i])) - return -1; - return i; -} -#endif - static void txtfmt_osl_format_line(SpaceText *st, TextLine *line, const int do_next) { FlattenString fs; diff --git a/source/blender/editors/space_text/text_format_py.c b/source/blender/editors/space_text/text_format_py.c index 02b67c32052..a78dabbfb9b 100644 --- a/source/blender/editors/space_text/text_format_py.c +++ b/source/blender/editors/space_text/text_format_py.c @@ -127,8 +127,8 @@ static int txtfmt_py_find_decorator(const char *string) { if (string[0] == '@') { int i = 1; - /* whitespace is ok '@ foo' */ - while (string[i] == '\t' || string[i] == ' ') { + /* Whitespace is ok '@ foo' */ + while (text_check_whitespace(string[i])) { i++; } while (text_check_identifier(string[i])) { -- cgit v1.2.3