diff options
Diffstat (limited to 'src/main.zig')
| -rw-r--r-- | src/main.zig | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/main.zig b/src/main.zig index 9086fa90..26431324 100644 --- a/src/main.zig +++ b/src/main.zig @@ -707,7 +707,7 @@ fn nativeMain(std_init: std.process.Init) !void { opts.startup_config = found.bytes; opts.startup_config_path = found.path; opts.config_dir = found.dir; - opts.recent_path = recentPath(init.io, arena, init.environ_map); + opts.store_path = storePath(init.io, arena, init.environ_map); if (found.dir) |d| @import("crash.zig").setDir(d); if (detach) |name| { const named = if (name.len != 0) @@ -789,10 +789,11 @@ test { if (comptime pardes.font_picker) _ = @import("fonts.zig"); } -/// Where the list of files opened lately is kept: $XDG_STATE_HOME/pardes -/// /recent, else ~/.local/state/pardes/recent, the directory made if need -/// be; null with no home to keep it in (the list then lasts the session). -fn recentPath(io: std.Io, arena: std.mem.Allocator, env: *const std.process.Environ.Map) ?[]const u8 { +/// Where the store every window shares is kept (Store.zig): +/// $XDG_STATE_HOME/pardes/store, else ~/.local/state/pardes/store, the +/// directory made if need be; null with no home to keep it in (Recent and +/// the closed panes then last the session). +fn storePath(io: std.Io, arena: std.mem.Allocator, env: *const std.process.Environ.Map) ?[]const u8 { const dir = dir: { if (env.get("XDG_STATE_HOME")) |base| if (base.len != 0 and std.fs.path.isAbsolute(base)) break :dir std.fs.path.join(arena, &.{ base, "pardes" }) catch return null; @@ -801,5 +802,5 @@ fn recentPath(io: std.Io, arena: std.mem.Allocator, env: *const std.process.Envi break :dir std.fs.path.join(arena, &.{ home, ".local", "state", "pardes" }) catch return null; }; std.Io.Dir.cwd().createDirPath(io, dir) catch return null; - return std.fs.path.join(arena, &.{ dir, "recent" }) catch null; + return std.fs.path.join(arena, &.{ dir, "store" }) catch null; } |
