Skip to content

Commit

Permalink
Merge pull request #85228 from KoBeWi/don't_save_scene_when_saving_sc…
Browse files Browse the repository at this point in the history
…ript_while_saving_scene

Don't insert newline while saving
  • Loading branch information
akien-mga committed Jun 26, 2024
2 parents 869e332 + b70368b commit b0c7f45
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
4 changes: 1 addition & 3 deletions editor/editor_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1812,9 +1812,7 @@ static void _reset_animation_mixers(Node *p_node, List<Pair<AnimationMixer *, Re
}

void EditorNode::_save_scene(String p_file, int idx) {
if (!saving_scene.is_empty() && saving_scene == p_file) {
return;
}
ERR_FAIL_COND_MSG(!saving_scene.is_empty() && saving_scene == p_file, "Scene saved while already being saved!");

Node *scene = editor_data.get_edited_scene_root(idx);

Expand Down
9 changes: 1 addition & 8 deletions editor/plugins/script_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1012,8 +1012,6 @@ void ScriptEditor::_resave_scripts(const String &p_str) {
se->trim_final_newlines();
}

se->insert_final_newline();

if (convert_indent_on_save) {
se->convert_indent();
}
Expand Down Expand Up @@ -1410,8 +1408,6 @@ void ScriptEditor::_menu_option(int p_option) {
current->trim_final_newlines();
}

current->insert_final_newline();

if (convert_indent_on_save) {
current->convert_indent();
}
Expand Down Expand Up @@ -2614,8 +2610,6 @@ void ScriptEditor::save_current_script() {
current->trim_final_newlines();
}

current->insert_final_newline();

if (convert_indent_on_save) {
current->convert_indent();
}
Expand Down Expand Up @@ -2662,8 +2656,6 @@ void ScriptEditor::save_all_scripts() {
se->trim_final_newlines();
}

se->insert_final_newline();

if (!se->is_unsaved()) {
continue;
}
Expand Down Expand Up @@ -2713,6 +2705,7 @@ void ScriptEditor::apply_scripts() const {
if (!se) {
continue;
}
se->insert_final_newline();
se->apply_code();
}
}
Expand Down

0 comments on commit b0c7f45

Please sign in to comment.