mirror of
https://github.com/godotengine/godot.git
synced 2025-10-25 10:44:26 +00:00
Automatically add new line to scripts
This commit is contained in:
parent
06e580f5ba
commit
7fbb6d986f
10 changed files with 46 additions and 1 deletions
|
|
@ -681,6 +681,8 @@ void ScriptEditor::_resave_scripts(const String &p_str) {
|
|||
se->trim_trailing_whitespace();
|
||||
}
|
||||
|
||||
se->insert_final_newline();
|
||||
|
||||
if (convert_indent_on_save) {
|
||||
if (use_space_indentation) {
|
||||
se->convert_indent_to_spaces();
|
||||
|
|
@ -1033,6 +1035,8 @@ void ScriptEditor::_menu_option(int p_option) {
|
|||
if (trim_trailing_whitespace_on_save)
|
||||
current->trim_trailing_whitespace();
|
||||
|
||||
current->insert_final_newline();
|
||||
|
||||
if (convert_indent_on_save) {
|
||||
if (use_space_indentation) {
|
||||
current->convert_indent_to_spaces();
|
||||
|
|
@ -1052,7 +1056,10 @@ void ScriptEditor::_menu_option(int p_option) {
|
|||
} break;
|
||||
case FILE_SAVE_AS: {
|
||||
|
||||
current->trim_trailing_whitespace();
|
||||
if (trim_trailing_whitespace_on_save)
|
||||
current->trim_trailing_whitespace();
|
||||
|
||||
current->insert_final_newline();
|
||||
|
||||
if (convert_indent_on_save) {
|
||||
if (use_space_indentation) {
|
||||
|
|
@ -2046,6 +2053,8 @@ void ScriptEditor::save_all_scripts() {
|
|||
se->trim_trailing_whitespace();
|
||||
}
|
||||
|
||||
se->insert_final_newline();
|
||||
|
||||
if (!se->is_unsaved())
|
||||
continue;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue