fix: make sure to show_home if no files are opened via command line

This commit is contained in:
CJ van den Berg 2025-07-01 11:38:46 +02:00
parent a4bd395122
commit f9189722c2
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -273,6 +273,7 @@ pub fn main() anyerror!void {
}
var have_project = false;
var have_file = false;
if (args.project) |project| {
try tui_proc.send(.{ "cmd", "open_project_dir", .{project} });
have_project = true;
@ -286,13 +287,16 @@ pub fn main() anyerror!void {
try tui_proc.send(.{ "cmd", "open_project_dir", .{dir.path} });
have_project = true;
},
else => {},
else => {
have_file = true;
},
};
for (links.items) |link| {
try file_link.navigate(tui_proc.ref(), &link);
}
if (links.items.len == 0) {
if (!have_file) {
if (!have_project)
try tui_proc.send(.{ "cmd", "open_project_cwd" });
try tui_proc.send(.{ "cmd", "show_home" });