diff options
Diffstat (limited to 'source/blender/editors/space_text')
-rw-r--r-- | source/blender/editors/space_text/text_ops.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index 0f3b54a7b4b..ce7db83d6d8 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -215,6 +215,7 @@ static int open_exec(bContext *C, wmOperator *op) PropertyPointerRNA *pprop; PointerRNA idptr; char str[FILE_MAX]; + short internal = RNA_int_get(op->ptr, "internal"); RNA_string_get(op->ptr, "path", str); @@ -244,6 +245,13 @@ static int open_exec(bContext *C, wmOperator *op) st->text= text; st->top= 0; } + + if (internal) { + if(text->name) + MEM_freeN(text->name); + + text->name = NULL; + } WM_event_add_notifier(C, NC_TEXT|NA_ADDED, text); @@ -282,6 +290,7 @@ void TEXT_OT_open(wmOperatorType *ot) /* properties */ WM_operator_properties_filesel(ot, FOLDERFILE|TEXTFILE|PYSCRIPTFILE, FILE_SPECIAL, FILE_OPENFILE); + RNA_def_boolean(ot->srna, "internal", 0, "Make internal", "Make text file internal after loading"); } /******************* reload operator *********************/ |