From b55cb01d2777760ed79b545dfca7115837591577 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 1 Oct 2026 21:55:57 -0300 Subject: An undo step keeps no copy of the name: History keeps each name once, at the rename that ends it, and a step its generation, so typing allocates a snapshot and nothing more (follows prwqwwxt); a rename of one Zerox twin is logged for each twin Co-Authored-By: Claude Opus 5.5 --- src/ninep/pane.zig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/ninep') diff --git a/src/ninep/pane.zig b/src/ninep/pane.zig index 981c2b0e..3b70d62f 100644 --- a/src/ninep/pane.zig +++ b/src/ninep/pane.zig @@ -982,7 +982,8 @@ pub fn nameBuffer(p: *Pardes, id: usize, full: []const u8, preserve_tag: bool) ! if (std.mem.indexOfAny(u8, full, "\x00\n") != null) return error.InvalidName; if (std.mem.eql(u8, f.path, full)) return; const copy = try p.gpa.dupe(u8, full); - p.gpa.free(f.path); + // The name it ends is kept for an undo back across this rename. + panes.File.noteRenamed(p.gpa, f.history, f.path); f.path = copy; if (panes.Output.fileTraits(f.output).saves) { f.output = null; -- cgit v1.3