[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [53409] trunk/blender/source/blender/ editors/space_text/text_format_py.c: fix for 2 errors in python syntax highlighting, no space was allowed in decorators and decorators where being skipped.

Campbell Barton ideasman42 at gmail.com
Sat Dec 29 19:20:19 CET 2012


Revision: 53409
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=53409
Author:   campbellbarton
Date:     2012-12-29 18:20:14 +0000 (Sat, 29 Dec 2012)
Log Message:
-----------
fix for 2 errors in python syntax highlighting, no space was allowed in decorators and decorators where being skipped.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_text/text_format_py.c

Modified: trunk/blender/source/blender/editors/space_text/text_format_py.c
===================================================================
--- trunk/blender/source/blender/editors/space_text/text_format_py.c	2012-12-29 17:49:43 UTC (rev 53408)
+++ trunk/blender/source/blender/editors/space_text/text_format_py.c	2012-12-29 18:20:14 UTC (rev 53409)
@@ -127,6 +127,10 @@
 {
 	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 @@
 				}
 			}
 			/* 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) */




More information about the Bf-blender-cvs mailing list