From 06d879ca1a896db73af89037ddcf5c317e1389a7 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 1 Oct 2026 11:18:32 -0300 Subject: A bare Save on a +-named pane that is no output (+Tutor) asks for a path, as +New's does, never writing a file named +Tutor Co-Authored-By: Claude Opus 5.5 --- src/builtins.zig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/builtins.zig') diff --git a/src/builtins.zig b/src/builtins.zig index b9cf4840..cca7bfb5 100644 --- a/src/builtins.zig +++ b/src/builtins.zig @@ -1124,7 +1124,9 @@ pub const Save = struct { return c.p.reportFailure(c.id, if (c.pane.hasPdf()) "Save: a PDF pane has no text to save" else "Save: an image pane has no text to save"); const path = std.mem.trim(u8, c.arg orelse "", " \t\r\n"); if (path.len > 0) return exec.saveTo(c.p, c.id, path); - if (c.pane.file) |file| if (file.output == null) return exec.saveFile(c.p, c.id); + // A `+` name is a generated pane's (+Tutor), no file of its own: + // a bare Save asks for a path, as a +New scratch's does. + if (c.pane.file) |file| if (file.output == null and !std.mem.startsWith(u8, std.fs.path.basename(file.path), "+")) return exec.saveFile(c.p, c.id); if (c.pane.file != null or c.pane.isTerminal()) c.p.startPrompt(c.pane, &c.pane.body, .save); } }; -- cgit v1.3