feat: make change_project call open_recent instead of jumping to last file
This commit is contained in:
parent
4ee3dd4bba
commit
a9380e0395
1 changed files with 1 additions and 7 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue