From a9380e0395bfa934abc6563775724760096566f1 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Mon, 4 Aug 2025 20:53:35 +0200 Subject: [PATCH] feat: make change_project call open_recent instead of jumping to last file --- src/tui/mainview.zig | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/tui/mainview.zig b/src/tui/mainview.zig index f32b90a..b0c2c03 100644 --- a/src/tui/mainview.zig +++ b/src/tui/mainview.zig @@ -337,8 +337,7 @@ const cmds = struct { tui.rdr().set_terminal_working_directory(project); if (self.top_bar) |bar| _ = try bar.msg(.{ "PRJ", "open" }); if (self.bottom_bar) |bar| _ = try bar.msg(.{ "PRJ", "open" }); - if (try project_manager.request_most_recent_file(self.allocator)) |file_path| - self.show_file_async_and_free(file_path); + tp.self_pid().send(.{ "cmd", "open_recent" }) catch return; } pub const change_project_meta: Meta = .{ .arguments = &.{.string} }; @@ -1224,11 +1223,6 @@ fn toggle_inputview_async(_: *Self) void { tp.self_pid().send(.{ "cmd", "toggle_inputview" }) catch return; } -fn show_file_async_and_free(self: *Self, file_path: []const u8) void { - defer self.allocator.free(file_path); - self.show_file_async(file_path); -} - fn show_file_async(_: *Self, file_path: []const u8) void { tp.self_pid().send(.{ "cmd", "navigate", .{ .file = file_path } }) catch return; }