diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-30 23:24:00 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:18 -0300 |
| commit | 5761f97293960ee7035f7866f09a9826a9e2f74a (patch) | |
| tree | 4666a3bcf5bd79d53dc590348922c8f1068be1f0 /src/Output.zig | |
| parent | e3cf9c1ffb54a64ee519f02afec17e6859ef8242 (diff) | |
| download | pardes-5761f97293960ee7035f7866f09a9826a9e2f74a.tar.gz pardes-5761f97293960ee7035f7866f09a9826a9e2f74a.zip | |
A refusal's +Unsaved goes in the session's directory when the active pane's directory is not there
Exit or Restore refused over a pane named into a directory that does
not exist made +Unsaved in that missing directory, where its rows
could not be looked at and a Save of it could only fail. The list now
goes in the session's directory when the asking pane's is not on disk.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/Output.zig')
| -rw-r--r-- | src/Output.zig | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Output.zig b/src/Output.zig index 4aa0c021..1160c455 100644 --- a/src/Output.zig +++ b/src/Output.zig @@ -656,7 +656,10 @@ pub fn openUnsaved(p: *Pardes, id: usize, content: []u8) void { return; } const pane = p.panes[id] orelse return p.gpa.free(content); - const dir = if (pane.file) |f| (std.fs.path.dirname(f.path) orelse "/") else pane.cwdSlice(); + const own = if (pane.file) |f| (std.fs.path.dirname(f.path) orelse "/") else pane.cwdSlice(); + // Its directory gone (or never there, a name not yet saved): the list + // goes in the session's, where a look from it can still resolve. + const dir = if (comptime pardes.hosted) (if (pardes.filesystem.localPath(own)) |local| (if (exec.isDirectory(local)) own else p.sessionDir()) else own) else own; const free = p.freeSlot() orelse return p.gpa.free(content); _ = open(p, free, dir, .unsaved, "", content) catch return; exec.placeNew(p, id, id, free, .doc); |
