diff options
Diffstat (limited to 'src/pardes.zig')
| -rw-r--r-- | src/pardes.zig | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/pardes.zig b/src/pardes.zig index da9889ff..f55654b6 100644 --- a/src/pardes.zig +++ b/src/pardes.zig @@ -7096,6 +7096,17 @@ test "Del from a key asks which neighbour takes the rows; nothing else asks" { try std.testing.expectEqual(ctlfs.Status.ok, th.wr(p, ctl, "answer -\n").reply.status); try std.testing.expect(p.panes[asked] != null and p.panes[asked].?.prompt == .none); try std.testing.expect(th.logHas(p, try std.fmt.bufPrint(&want, "answer {d} -\n", .{serial}))); + // A pane closed while its question stands ends the question in the log. + p.newScratchBelow(top); + const closing = p.active; + p.sync(); + const closing_serial = p.panes[closing].?.serial; + p.update(.{ .key = .{ .cp = ' ' } }); + p.update(.{ .key = .{ .cp = 'd' } }); + try std.testing.expectEqual(Pane.Prompt.del_side, p.panes[closing].?.prompt); + try p.removePane(closing, null); + try std.testing.expect(th.logHas(p, try std.fmt.bufPrint(&want, "answer {d} -\ndel {d}", .{ closing_serial, closing_serial }))); + p.active = asked; p.update(.{ .key = .{ .cp = ' ' } }); p.update(.{ .key = .{ .cp = 'd' } }); try std.testing.expectEqual(ctlfs.Status.ok, th.wr(p, ctl, "answer k\n").reply.status); |
