diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2011-04-16 13:58:50 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2011-04-16 13:58:50 +0400 |
commit | dbf509237e6b831c5e7702b4db630631028d5a1a (patch) | |
tree | 3f24aca86cc531d41684c823ddde96004a75d44e /source/blender/blenkernel/intern/text.c | |
parent | 71f571a54d9dd06a1187f7441e6ee85021c11e7a (diff) |
Fix for IRC reported bug from Dalai:
Text editor used to add extra indentation when inserting new line from
line with dictionary. Also, fixed extra indentation when comma is inside string.
Diffstat (limited to 'source/blender/blenkernel/intern/text.c')
-rw-r--r-- | source/blender/blenkernel/intern/text.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c index 376f3fb031f..e7b85ec9b17 100644 --- a/source/blender/blenkernel/intern/text.c +++ b/source/blender/blenkernel/intern/text.c @@ -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; } } |