diff options
Diffstat (limited to 'src/edit.zig')
| -rw-r--r-- | src/edit.zig | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/edit.zig b/src/edit.zig index bf65935e..b2909d87 100644 --- a/src/edit.zig +++ b/src/edit.zig @@ -2166,6 +2166,18 @@ test "Enter in insert mode keeps a tab-indented line's tabs, as o and O do" { try std.testing.expect(std.mem.startsWith(u8, pane.file.?.content, "\t\tvalue = 1;\n\t\t\n")); } +test "insert on a terminal's text says it edits a copy the program's next drawing replaces" { + const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true }); + defer p.deinit(); + while (p.nextEffect()) |_| {} + const pane = p.panes[0].?; + if (!pane.isTerminal()) return error.SkipZigTest; + pane.body.mode = .normal; + p.update(.{ .key = .{ .cp = 'i' } }); + p.update(.{ .key = .{ .cp = 'x', .text = "x" } }); + try std.testing.expect(std.mem.indexOf(u8, pane.msg[0..pane.msg_len], "a copy of the terminal's text") != null); +} + test "insert and normal modes edit complete Unicode graphemes" { const gpa = std.testing.allocator; const p = try Pardes.init(gpa, .{ .cols = 60, .rows = 12 }); |
