From f3e6569e00b6fcebe5f932d91cf0df24411ce062 Mon Sep 17 00:00:00 2001 From: Paulb23 Date: Sat, 23 Apr 2016 19:21:34 +0100 Subject: [PATCH] Trim trailing white space on save, issue 4383 --- tools/editor/editor_settings.cpp | 1 + tools/editor/plugins/script_editor_plugin.cpp | 51 +++++++++++++++++-- tools/editor/plugins/script_editor_plugin.h | 5 ++ 3 files changed, 54 insertions(+), 3 deletions(-) diff --git a/tools/editor/editor_settings.cpp b/tools/editor/editor_settings.cpp index 06e92028c79..cf9353a8572 100644 --- a/tools/editor/editor_settings.cpp +++ b/tools/editor/editor_settings.cpp @@ -421,6 +421,7 @@ void EditorSettings::_load_defaults(Ref p_extra_config) { set("text_editor/show_line_numbers", true); + set("text_editor/trim_trailing_whitespace_on_save", false); set("text_editor/idle_parse_delay",2); set("text_editor/create_signal_callbacks",true); set("text_editor/autosave_interval_secs",0); diff --git a/tools/editor/plugins/script_editor_plugin.cpp b/tools/editor/plugins/script_editor_plugin.cpp index 6ed44901f17..6515b9b69e8 100644 --- a/tools/editor/plugins/script_editor_plugin.cpp +++ b/tools/editor/plugins/script_editor_plugin.cpp @@ -620,6 +620,34 @@ void ScriptEditor::_script_created(Ref