diff options
-rw-r--r-- | release/scripts/ui/space_userpref.py | 1 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/text.c | 11 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_userdef_types.h | 1 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_userdef.c | 4 | ||||
-rw-r--r-- | source/creator/creator.c | 2 |
5 files changed, 14 insertions, 5 deletions
diff --git a/release/scripts/ui/space_userpref.py b/release/scripts/ui/space_userpref.py index 259e10cdcfe..ed834992427 100644 --- a/release/scripts/ui/space_userpref.py +++ b/release/scripts/ui/space_userpref.py @@ -423,6 +423,7 @@ class USERPREF_PT_system(bpy.types.Panel): col.prop(system, "frame_server_port") col.prop(system, "scrollback", text="Console Scrollback") col.prop(system, "auto_execute_scripts") + col.prop(system, "tabs_as_spaces") col.separator() col.separator() 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); diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index 85c6e73a909..945a1977f03 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -406,6 +406,7 @@ extern UserDef U; /* from blenkernel blender.c */ #define USER_SCRIPT_AUTOEXEC_DISABLE (1 << 22) #define USER_FILENOUI (1 << 23) #define USER_NONEGFRAMES (1 << 24) +#define USER_TXT_TABSTOSPACES (1 << 25) /* helper macro for checking frame clamping */ #define FRAMENUMBER_MIN_CLAMP(cfra) \ diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 6f6ee5216ae..536942bb9a9 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -2358,6 +2358,10 @@ static void rna_def_userdef_system(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Auto Run Python Scripts", "Allow any .blend file to run scripts automatically (unsafe with blend files from an untrusted source)"); RNA_def_property_update(prop, 0, "rna_userdef_script_autoexec_update"); + prop= RNA_def_property(srna, "tabs_as_spaces", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_TXT_TABSTOSPACES); + RNA_def_property_ui_text(prop, "Tabs as Spaces", "Automatically converts all new tabs into spaces in Text Editor"); + prop= RNA_def_property(srna, "prefetch_frames", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "prefetchframes"); RNA_def_property_range(prop, 0, 500); diff --git a/source/creator/creator.c b/source/creator/creator.c index 1d811ba61f3..79272568261 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -1038,7 +1038,7 @@ int main(int argc, char **argv) } else { - if(G.fileflags & G_FILE_AUTOPLAY){ + if((G.fileflags & (G_FILE_AUTOPLAY | G_SCRIPT_AUTOEXEC)){ WM_init_game(C); } |