Fix #27505: Text Editor always indent next line when a " is found (which is not alway...
authorSergey Sharybin <sergey.vfx@gmail.com>
Sat, 28 May 2011 14:40:42 +0000 (14:40 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Sat, 28 May 2011 14:40:42 +0000 (14:40 +0000)
Do not indent if there's any non-space character after colon.

This only makes life a bit easier, but it's still not 100% correct indentation
strategy. For example when colon is inside non-closed string or so.
Also there's not indentation for { and un-indentation for }.

Handling such cases would require much smarter strategy..

source/blender/blenkernel/intern/text.c

index 578b2d57e944579f0c6486a96f6d69644c4d420a..c9862ec3ede09b0c402d4a41b7108667422b7c5a 100644 (file)
@@ -2759,7 +2759,7 @@ int setcurr_tab_spaces (Text *text, int space)
                                break;
                        } else if (ch==':') {
                                is_indent = 1;
-                       } else if (ch==']' || ch=='}' || ch=='"' || ch=='\'') {
+                       } else if (ch!=' ' && ch!='\t') {
                                is_indent = 0;
                        }
                }