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 | |
parent | b278279c95c9396432a66ef50499e45389e9ec18 (diff) |
syntax highlighting for decorators, correct doc example
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/space_text/text_draw.c | 14 | ||||
-rw-r--r-- | source/blender/python/doc/examples/mathutils.py | 4 |
2 files changed, 16 insertions, 2 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++; diff --git a/source/blender/python/doc/examples/mathutils.py b/source/blender/python/doc/examples/mathutils.py index 4a5de5887c9..0b30a0f4505 100644 --- a/source/blender/python/doc/examples/mathutils.py +++ b/source/blender/python/doc/examples/mathutils.py @@ -3,8 +3,8 @@ from math import radians vec = mathutils.Vector((1.0, 2.0, 3.0)) -mat_rot = mathutils.RotationMatrix(radians(90), 4, 'X') -mat_trans = mathutils.TranslationMatrix(vec) +mat_rot = mathutils.Matrix.Rotation(radians(90), 4, 'X') +mat_trans = mathutils.Matrix.Translation(vec) mat = mat_trans * mat_rot mat.invert() |