diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-08-17 18:56:10 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-08-17 18:56:10 +0400 |
commit | fab0f053e76a64126b0d259af0613a34b87c4f23 (patch) | |
tree | 2f9281d629caa1f06f20deaf36dc14d49a30cbab /source/blender/editors/space_text/text_draw.c | |
parent | b278279c95c9396432a66ef50499e45389e9ec18 (diff) |
syntax highlighting for decorators, correct doc example
Diffstat (limited to 'source/blender/editors/space_text/text_draw.c')
-rw-r--r-- | source/blender/editors/space_text/text_draw.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c index 051202b28ef..62274fc664a 100644 --- a/source/blender/editors/space_text/text_draw.c +++ b/source/blender/editors/space_text/text_draw.c @@ -222,6 +222,18 @@ static int find_specialvar(char *string) return i; } +static int find_decorator(char *string) +{ + if(string[0] == '@') { + int i = 1; + while(text_check_identifier(string[i])) { + i++; + } + return i; + } + return -1; +} + static int find_bool(char *string) { int i = 0; @@ -375,6 +387,8 @@ static void txt_format_line(SpaceText *st, TextLine *line, int do_next) prev = 'v'; else if((i=find_builtinfunc(str)) != -1) prev = 'b'; + else if((i=find_decorator(str)) != -1) + prev = 'v'; /* could have a new color for this */ if(i>0) { while(i>1) { *fmt = prev; fmt++; str++; |