You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Merge pull request #87099 from bitwise-aiden/ba-add-trim-newlines
Implement `trim_final_newlines` setting and functionality
This commit is contained in:
@@ -770,6 +770,7 @@ void TextShaderEditor::_apply_editor_settings() {
|
||||
code_editor->update_editor_settings();
|
||||
|
||||
trim_trailing_whitespace_on_save = EDITOR_GET("text_editor/behavior/files/trim_trailing_whitespace_on_save");
|
||||
trim_final_newlines_on_save = EDITOR_GET("text_editor/behavior/files/trim_final_newlines_on_save");
|
||||
}
|
||||
|
||||
void TextShaderEditor::_show_warnings_panel(bool p_show) {
|
||||
@@ -934,6 +935,10 @@ void TextShaderEditor::save_external_data(const String &p_str) {
|
||||
trim_trailing_whitespace();
|
||||
}
|
||||
|
||||
if (trim_final_newlines_on_save) {
|
||||
trim_final_newlines();
|
||||
}
|
||||
|
||||
apply_shaders();
|
||||
|
||||
Ref<Shader> edited_shader = code_editor->get_edited_shader();
|
||||
@@ -960,6 +965,10 @@ void TextShaderEditor::trim_trailing_whitespace() {
|
||||
code_editor->trim_trailing_whitespace();
|
||||
}
|
||||
|
||||
void TextShaderEditor::trim_final_newlines() {
|
||||
code_editor->trim_final_newlines();
|
||||
}
|
||||
|
||||
void TextShaderEditor::validate_script() {
|
||||
code_editor->_validate_script();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user