diff --git a/ServerUI.gd b/ServerUI.gd index 503f05a..28e18d3 100644 --- a/ServerUI.gd +++ b/ServerUI.gd @@ -10,7 +10,7 @@ const START_BUTTON_SERVER_TEXT: Dictionary = { false: "Start server", } -const ACCEPTED_FILE_FORMATS := ["md"] # server should ignore these file types when adding endpoints +const ACCEPTED_FILE_FORMATS := ["md"] export(bool) var enable_file_autosave := true # if true, will save the active file's contents every save_file_timeout seconds. export(float) var save_file_timeout := 4.0 # the time to save document content after the edited signal of TextEdit @@ -170,7 +170,7 @@ func _generate_filestxt(): for file in working_files: file = file as FileDef if file.include_in_filestxt: - files += "%s %s %s\n" % [file.file_path, file.date, file.title] + files += ("%s %s %s\n" % [file.file_path, file.date, file.title]).strip_edges(false, true) var f := File.new() if f.open(server_dir.plus_file("files.txt"), File.WRITE) == OK: @@ -243,6 +243,10 @@ func _set_file_tree_disabled(disabled: bool) -> void: tree_item = tree_item.get_next() +func _set_context_menu_disabled(disabled: bool) -> void: + pass + + func _on_FileTreeContextMenu_id_pressed(id: int) -> void: var idx = current_tree_selection.get_metadata(0)["id"] as int var fd = working_files[idx] as FileDef