From e30773870f047b3c35e9b51a3756ae998e559d64 Mon Sep 17 00:00:00 2001 From: falsycat Date: Mon, 5 May 2025 10:51:30 +0900 Subject: [PATCH] separate permanentized data in workspace --- src/hncore/Workspace.zig | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/src/hncore/Workspace.zig b/src/hncore/Workspace.zig index 25da730..fb9517d 100644 --- a/src/hncore/Workspace.zig +++ b/src/hncore/Workspace.zig @@ -3,20 +3,36 @@ const std = @import("std"); const CommandHistory = @import("./CommandHistory.zig"); const TaskStore = @import("./TaskStore.zig"); +/// const Self = @This(); -tasks: TaskStore, +/// +const Perma = struct { + tasks: TaskStore, +}; + +/// commands: CommandHistory, +/// +perma: Perma, + +/// pub fn init(allocator: std.mem.Allocator) Self { return Self { .commands = CommandHistory.init(allocator), - .tasks = TaskStore.init(allocator), + .perma = .{ + .tasks = TaskStore.init(allocator), + }, }; } + +/// pub fn deinit(self: *Self) void { - self.tasks.deinit(); + self.perma.tasks.deinit(); + self.commands.deinit(); } + test { var ws = init(std.testing.allocator); defer ws.deinit();