From 4474933e54a84df35935eceac4e723bcf6f59e69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81d=C3=A1m=20Kov=C3=A1cs?= Date: Tue, 17 Jun 2025 11:23:13 +0200 Subject: [PATCH] fix: gui start path --- src/gui/main.zig | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/gui/main.zig b/src/gui/main.zig index 63ab73c..7ec5a4a 100644 --- a/src/gui/main.zig +++ b/src/gui/main.zig @@ -43,18 +43,16 @@ pub fn main() !void { try rootProvider.providers.append(&localContentProv); - const home_path = try std.fs.cwd().realpathAlloc(allocator, "."); - defer allocator.free(home_path); + const current_path = try std.fs.cwd().realpathAlloc(allocator, "."); + defer allocator.free(current_path); - const start_path = try std.fmt.allocPrint(allocator, "local/{s}", .{home_path}); - defer allocator.free(start_path); - - const homeFullName: models.FullName = .{ .path = start_path }; + const start_full_name = try local_provider.getFullNameByNativePath(allocator, models.NativePath{ .path = current_path }); + defer allocator.free(start_full_name.path); var tab1 = try allocator.create(Tab); tab1.init(&pool, &rootProvider, allocator); - try tab1.setCurrentLocation(homeFullName); + try tab1.setCurrentLocation(start_full_name); var appState: AppState = AppState.init(allocator); try appState.addTab(tab1);