From 14ea0845807dc98a9d4601fcb5d7b232262be5dd Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 29 Dec 2012 18:20:14 +0000 Subject: [PATCH] fix for 2 errors in python syntax highlighting, no space was allowed in decorators and decorators where being skipped. --- source/blender/editors/space_text/text_format_py.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/blender/editors/space_text/text_format_py.c b/source/blender/editors/space_text/text_format_py.c index 7c5d0231d63..44c4fc7d03b 100644 --- a/source/blender/editors/space_text/text_format_py.c +++ b/source/blender/editors/space_text/text_format_py.c @@ -127,6 +127,10 @@ 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] == ' ') { + i++; + } while (text_check_identifier(string[i])) { i++; } @@ -250,7 +254,7 @@ static void txtfmt_py_format_line(SpaceText *st, TextLine *line, const int do_ne } } /* Punctuation */ - else if (text_check_delim(*str)) { + else if ((*str != '@') && text_check_delim(*str)) { *fmt = '!'; } /* Identifiers and other text (no previous ws. or delims. so text continues) */