summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/object/undo_redo.cpp8
-rw-r--r--editor/plugins/script_editor_plugin.cpp18
2 files changed, 11 insertions, 15 deletions
diff --git a/core/object/undo_redo.cpp b/core/object/undo_redo.cpp
index 905bb587a8..289caf5247 100644
--- a/core/object/undo_redo.cpp
+++ b/core/object/undo_redo.cpp
@@ -104,14 +104,6 @@ void UndoRedo::create_action(const String &p_name, MergeMode p_mode) {
memdelete(obj);
}
}
- String s = "removed " + E->get().name + ": ";
- for (int j = 0; j < VARIANT_ARG_MAX; j++) {
- if (E->get().args[j].get_type() == Variant::NIL) {
- break;
- }
- s += String(E->get().args[j]);
- }
- print_line(s);
E->erase();
}
}
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp
index 16c0358c9a..677a5f1f2c 100644
--- a/editor/plugins/script_editor_plugin.cpp
+++ b/editor/plugins/script_editor_plugin.cpp
@@ -763,20 +763,24 @@ void ScriptEditor::_close_tab(int p_idx, bool p_save, bool p_history_back) {
ScriptEditorBase *current = Object::cast_to<ScriptEditorBase>(tselected);
if (current) {
- Ref<Script> script = current->get_edited_resource();
- if (p_save && script.is_valid()) {
+ RES file = current->get_edited_resource();
+ if (p_save && file.is_valid()) {
// Do not try to save internal scripts, but prompt to save in-memory
// scripts which are not saved to disk yet (have empty path).
- if (script->get_path().find("local://") == -1 && script->get_path().find("::") == -1) {
+ if (file->get_path().find("local://") == -1 && file->get_path().find("::") == -1) {
save_current_script();
}
}
- if (script.is_valid()) {
- if (!script->get_path().is_empty()) {
+ if (file.is_valid()) {
+ if (!file->get_path().is_empty()) {
// Only saved scripts can be restored.
- previous_scripts.push_back(script->get_path());
+ previous_scripts.push_back(file->get_path());
+ }
+
+ Ref<Script> script = file;
+ if (script.is_valid()) {
+ notify_script_close(script);
}
- notify_script_close(script);
}
}