From b70368b78a1c7960580be5a2c6e257148e483830 Mon Sep 17 00:00:00 2001 From: kobewi Date: Wed, 22 Nov 2023 17:33:38 +0100 Subject: [PATCH] Don't insert newline while saving --- editor/editor_node.cpp | 4 +--- editor/plugins/script_editor_plugin.cpp | 9 +-------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 55487f7896b3..ea42fff85ac8 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -1812,9 +1812,7 @@ static void _reset_animation_mixers(Node *p_node, Listtrim_final_newlines(); } - se->insert_final_newline(); - if (convert_indent_on_save) { se->convert_indent(); } @@ -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(); } @@ -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(); } @@ -2662,8 +2656,6 @@ void ScriptEditor::save_all_scripts() { se->trim_final_newlines(); } - se->insert_final_newline(); - if (!se->is_unsaved()) { continue; } @@ -2713,6 +2705,7 @@ void ScriptEditor::apply_scripts() const { if (!se) { continue; } + se->insert_final_newline(); se->apply_code(); } }