You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Implement trim_final_newlines functionality
This commit is contained in:
@@ -756,6 +756,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) {
|
||||
@@ -920,6 +921,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();
|
||||
@@ -946,6 +951,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