From 73296a9a6da3e4c616cca9ffba62ff8918b9ae19 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 (cherry picked from commit f3e6569e00b6fcebe5f932d91cf0df24411ce062) --- 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 06c36456765..f30f320677b 100644 --- a/tools/editor/editor_settings.cpp +++ b/tools/editor/editor_settings.cpp @@ -498,6 +498,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 fba0eb5259d..04394daabd7 100644 --- a/tools/editor/plugins/script_editor_plugin.cpp +++ b/tools/editor/plugins/script_editor_plugin.cpp @@ -619,6 +619,34 @@ void ScriptEditor::_script_created(Ref