fix: add not-yet-persisted projects to recent_projecsts list
This commit is contained in:
parent
7744bdf6c4
commit
983e518f69
1 changed files with 14 additions and 0 deletions
|
|
@ -521,6 +521,20 @@ const Process = struct {
|
||||||
.last_used = std.math.maxInt(i128),
|
.last_used = std.math.maxInt(i128),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
var iter = self.projects.iterator();
|
||||||
|
while (iter.next()) |item| {
|
||||||
|
for (recent_projects.items) |*recent_project| {
|
||||||
|
if (std.mem.eql(u8, item.value_ptr.*.name, recent_project.name)) {
|
||||||
|
recent_project.last_used = item.value_ptr.*.last_used;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
(try recent_projects.addOne(self.allocator)).* = .{
|
||||||
|
.name = try self.allocator.dupe(u8, item.value_ptr.*.name),
|
||||||
|
.last_used = item.value_ptr.*.last_used,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
self.sort_projects_by_last_used(&recent_projects);
|
self.sort_projects_by_last_used(&recent_projects);
|
||||||
var message: std.Io.Writer.Allocating = .init(self.allocator);
|
var message: std.Io.Writer.Allocating = .init(self.allocator);
|
||||||
defer message.deinit();
|
defer message.deinit();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue