From 7554eeef535cad8db2b449ad7c9e7ff920ce64f7 Mon Sep 17 00:00:00 2001 From: luboslenco Date: Sun, 22 Sep 2024 17:48:17 +0200 Subject: [PATCH] Windows fixes --- base/sources/box_projects.ts | 7 +++---- base/sources/export_arm.ts | 3 +++ base/sources/import_arm.ts | 3 +++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/base/sources/box_projects.ts b/base/sources/box_projects.ts index 9a63c8c49..0cfca00fe 100644 --- a/base/sources/box_projects.ts +++ b/base/sources/box_projects.ts @@ -195,13 +195,12 @@ function box_projects_recent_tab(ui: ui_t) { for (let i: i32 = 0; i < config_raw.recent_projects.length; ++i) { let path: string = config_raw.recent_projects[i]; - let file: string = path; ///if arm_windows - file = string_replace_all(path, "/", "\\"); + path = string_replace_all(path, "/", "\\"); ///else - file = string_replace_all(path, "\\", "/"); + path = string_replace_all(path, "\\", "/"); ///end - file = substring(file, string_last_index_of(file, path_sep) + 1, file.length); + let file: string = substring(path, string_last_index_of(path, path_sep) + 1, path.length); if (string_index_of(to_lower_case(file), to_lower_case(box_projects_hsearch.text)) < 0) { continue; // Search filter diff --git a/base/sources/export_arm.ts b/base/sources/export_arm.ts index 67373286d..4f5fd875e 100644 --- a/base/sources/export_arm.ts +++ b/base/sources/export_arm.ts @@ -216,6 +216,9 @@ function export_arm_run_project() { ///else let recent_path: string = project_filepath; ///end + ///if arm_windows + recent_path = string_replace_all(recent_path, "\\", "/"); + ///end let recent: string[] = config_raw.recent_projects; array_remove(recent, recent_path); array_insert(recent, 0, recent_path); diff --git a/base/sources/import_arm.ts b/base/sources/import_arm.ts index 3fb7a0a84..0f614f91a 100644 --- a/base/sources/import_arm.ts +++ b/base/sources/import_arm.ts @@ -59,6 +59,9 @@ function import_arm_run_project(path: string) { ///else let recent_path: string = path; ///end + ///if arm_windows + recent_path = string_replace_all(recent_path, "\\", "/"); + ///end let recent: string[] = config_raw.recent_projects; array_remove(recent, recent_path); array_insert(recent, 0, recent_path);