From cdd7a7381343fbbe1fa417da6015b93b6a8a4f22 Mon Sep 17 00:00:00 2001 From: Relintai Date: Fri, 15 Jul 2022 14:13:02 +0200 Subject: [PATCH] Don't skip empty lines when saving a file. --- addons/file-editor/scripts/FileEditor.gd | 7 ++++--- project.pandemonium | 4 ++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/addons/file-editor/scripts/FileEditor.gd b/addons/file-editor/scripts/FileEditor.gd index 215ff07..d91fe0f 100644 --- a/addons/file-editor/scripts/FileEditor.gd +++ b/addons/file-editor/scripts/FileEditor.gd @@ -550,14 +550,15 @@ func create_new_file(given_path : String) -> void: func save_file(current_path : String) -> void: print("Saving file: ",current_path) + var current_file : File = File.new() current_file.open(current_path,File.WRITE) var current_content : String = "" var lines : int = current_editor.text_editor.get_line_count() - for line in range(0,lines): - if current_editor.text_editor.get_line(line) == "": - continue + for line in range(lines): + #if current_editor.text_editor.get_line(line) == "": + # continue current_content = current_editor.text_editor.get_text() current_file.store_line(current_editor.text_editor.get_line(line)) diff --git a/project.pandemonium b/project.pandemonium index cb34749..a10043a 100644 --- a/project.pandemonium +++ b/project.pandemonium @@ -13,6 +13,10 @@ config_version=4 config/name="fileed" config/icon="res://icon.png" +[editor_plugins] + +enabled=PoolStringArray( "res://addons/file-editor/plugin.cfg" ) + [physics] common/enable_pause_aware_picking=true