diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-12-29 22:20:14 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-12-29 22:20:14 +0400 |
commit | 14ea0845807dc98a9d4601fcb5d7b232262be5dd (patch) | |
tree | da8ff0776a120b9bf2ed53b25131ed8b221c388c /source/blender/editors/space_text/text_format_py.c | |
parent | abc5a6c3c8cb491abb1245225f164c1024f66da2 (diff) |
fix for 2 errors in python syntax highlighting, no space was allowed in decorators and decorators where being skipped.
Diffstat (limited to 'source/blender/editors/space_text/text_format_py.c')
-rw-r--r-- | source/blender/editors/space_text/text_format_py.c | 6 |
1 files changed, 5 insertions, 1 deletions
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) */ |