diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2010-03-07 00:45:46 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2010-03-07 00:45:46 +0300 |
commit | 782cb1f0e0d9c019bfb7b9391ffa4b827ed1aa6f (patch) | |
tree | dd8cab7e9f035c9403fdf526b3dc3d6e6e67d919 /source/blender/blenkernel | |
parent | 50b13f0a560ef6dabee413bbff3bd549209b8d11 (diff) |
Tab as Space as a User Preference option. to affect new and loaded text files.
* I put it under General->System. Not sure is the better place for it though (space_userpref.py)
** also: creator.c fix to avoid autoplay of games when scripts are disabled.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/text.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c index 4dcc26827d0..c28f4fde8ed 100644 --- a/source/blender/blenkernel/intern/text.c +++ b/source/blender/blenkernel/intern/text.c @@ -190,7 +190,9 @@ Text *add_empty_text(char *name) init_undo_text(ta); ta->nlines=1; - ta->flags= TXT_ISDIRTY | TXT_ISMEM | TXT_TABSTOSPACES; + ta->flags= TXT_ISDIRTY | TXT_ISMEM; + if(U.flag & USER_TXT_TABSTOSPACES) + ta->flags |= TXT_TABSTOSPACES; ta->lines.first= ta->lines.last= NULL; ta->markers.first= ta->markers.last= NULL; @@ -354,9 +356,10 @@ Text *add_text(char *file, const char *relpath) ta->lines.first= ta->lines.last= NULL; ta->markers.first= ta->markers.last= NULL; ta->curl= ta->sell= NULL; - - ta->flags= TXT_TABSTOSPACES; - + + if(U.flag & USER_TXT_TABSTOSPACES) + ta->flags= TXT_TABSTOSPACES; + fseek(fp, 0L, SEEK_END); len= ftell(fp); fseek(fp, 0L, SEEK_SET); |