浏览代码

Merge pull request #28695 from Ranoller/patch-2

FIX Script editor doesn´t send unsaved script #28693
Rémi Verschelde 6 年之前
父节点
当前提交
44bddecb89
共有 1 个文件被更改,包括 8 次插入0 次删除
  1. 8 0
      editor/plugins/script_editor_plugin.cpp

+ 8 - 0
editor/plugins/script_editor_plugin.cpp

@@ -388,6 +388,14 @@ void ScriptEditor::_save_history() {
 
 
 void ScriptEditor::_go_to_tab(int p_idx) {
 void ScriptEditor::_go_to_tab(int p_idx) {
 
 
+	ScriptEditorBase *current = _get_current_editor();
+	if (current) {
+		if (current->is_unsaved()) {
+
+			current->apply_code();
+		}
+	}
+
 	Control *c = Object::cast_to<Control>(tab_container->get_child(p_idx));
 	Control *c = Object::cast_to<Control>(tab_container->get_child(p_idx));
 	if (!c)
 	if (!c)
 		return;
 		return;