diff options
| -rw-r--r-- | src/pardes.zig | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/src/pardes.zig b/src/pardes.zig index e0311749..cd247272 100644 --- a/src/pardes.zig +++ b/src/pardes.zig @@ -5373,16 +5373,15 @@ pub const Pardes = struct { // Into a DumpDir that is not there: said so, ENOENT, as a Save is; // one that is there but no directory (`/dev/null`) says that. const parent = parentTrouble(path, err); - if (parent.denied and parent.kind == null) { - var said: [limits.host_path_cap + 48]u8 = undefined; - p.reportFailure(p.active, std.fmt.bufPrint(&said, "{s}: permission denied", .{operation}) catch "Dump: permission denied"); - } else if (parent.kind != null and parent.kind != .directory) { - var said: [limits.host_path_cap + 48]u8 = undefined; - p.reportFailure(p.active, std.fmt.bufPrint(&said, "{s}: {s} is not a directory", .{ operation, parent.dir }) catch "Dump: not a directory"); - } else if (parent.missing) { - var said: [limits.host_path_cap + 48]u8 = undefined; - p.reportFailure(p.active, std.fmt.bufPrint(&said, "{s}: no such directory", .{operation}) catch "Dump: no such directory"); - } else p.reportError(p.active, operation, err); + var said: [limits.host_path_cap + 48]u8 = undefined; + if (parent.denied and parent.kind == null) + p.reportFailure(p.active, std.fmt.bufPrint(&said, "{s}: permission denied", .{operation}) catch "Dump: permission denied") + else if (parent.kind != null and parent.kind != .directory) + p.reportFailure(p.active, std.fmt.bufPrint(&said, "{s}: {s} is not a directory", .{ operation, parent.dir }) catch "Dump: not a directory") + else if (parent.missing) + p.reportFailure(p.active, std.fmt.bufPrint(&said, "{s}: no such directory", .{operation}) catch "Dump: no such directory") + else + p.reportError(p.active, operation, err); // In the words the message row has, so the write's err is the one // record of it (its msg goes: 9p_io, dropMessage). p.noteLateFailure(p.active); @@ -6123,18 +6122,14 @@ pub const Pardes = struct { return; } const pending = pane.input.mode != .insert; - if (hit(key, config.escape) and !pending) { - pane.input.mode = .normal; - if (p.paneIdOf(pane)) |id| p.setMessage(id, "name drafted: Enter renames the buffer, Esc drops the draft"); - return; - } - if (hit(key, config.escape)) { + if (hit(key, config.escape) and pending) { pane.closePrompt(); pane.focus = .body; return; } - if (pending) { - if (p.paneIdOf(pane)) |id| p.setMessage(id, "name drafted: Enter renames the buffer, Esc drops the draft"); + if (hit(key, config.escape) or pending) { + pane.input.mode = .normal; + p.setMessage(p.active, "name drafted: Enter renames the buffer, Esc drops the draft"); return; } edit.handleInsert(p, &pane.input, key); |
