Fix for IRC reported bug from Dalai:
[blender.git] / source / blender / blenkernel / intern / text.c
index 376f3fb031f47a7cdd6004ce14f9ccfe151f917f..e7b85ec9b17ab8d82f14678999deb6abe98a3e46 100644 (file)
@@ -2719,11 +2719,12 @@ int setcurr_tab_spaces (Text *text, int space)
                int a, indent = 0;
                for(a=0; (a < text->curc) && (text->curl->line[a] != '\0'); a++)
                {
-                       if (text->curl->line[a]=='#') {
+                       char ch= text->curl->line[a];
+                       if (ch=='#') {
                                break;
-                       } else if (text->curl->line[a]==':') {
+                       } else if (ch==':') {
                                indent = 1;
-                       } else if (text->curl->line[a]==']') {
+                       } else if (ch==']' || ch=='}' || ch=='"' || ch=='\'') {
                                indent = 0;
                        }
                }