Skip to content

Commit

Permalink
Fix pad
Browse files Browse the repository at this point in the history
  • Loading branch information
luboslenco committed Nov 23, 2024
1 parent fd6ffc5 commit db9f173
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions base/tools/pad/sources/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ function encode_storage(): string {
json_encode_begin();
json_encode_string("project", storage.project);
json_encode_string("file", storage.file);
json_encode_string("text", storage.text);
// json_encode_string("text", storage.text);
json_encode_string("text", "");
json_encode_bool("modified", storage.modified);
json_encode_string_array("expanded", storage.expanded);
json_encode_i32("window_w", storage.window_w);
Expand Down Expand Up @@ -148,7 +149,12 @@ function list_folder(path: string) {
if (is_file) {
storage.file = abs;
let bytes: buffer_t = iron_load_blob(storage.file);
storage.text = ends_with(f, ".arm") ? armpack_to_string(bytes) : sys_buffer_to_string(bytes);
if (ends_with(f, ".arm")) {
storage.text = armpack_to_string(bytes);
}
else {
storage.text = sys_buffer_to_string(bytes);
}
storage.text = string_replace_all(storage.text, "\r", "");
text_handle.text = storage.text;
editor_handle.redraws = 1;
Expand All @@ -166,7 +172,9 @@ function list_folder(path: string) {
}

if (is_expanded) {
ui._x += 16;
list_folder(abs);
ui._x -= 16;
}
}
}
Expand Down

0 comments on commit db9f173

Please sign in to comment.