summaryrefslogtreecommitdiff
path: root/src/terminal.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/terminal.zig')
-rw-r--r--src/terminal.zig9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/terminal.zig b/src/terminal.zig
index 80b9455c..3bb1fbda 100644
--- a/src/terminal.zig
+++ b/src/terminal.zig
@@ -1637,6 +1637,11 @@ pub fn editText(p: *Pardes, pane: *Pane, lo: i32, hi: i32, col: i32) ?EditText {
if (pane.ovl) |overlay| p.gpa.free(overlay.text);
pane.ovl = .{ .row = row0, .rows = covered, .text = text };
}
+ // A terminal's text is its program's: edited here it is a copy, to run
+ // with Tab or B2, gone when the program draws again. Said at its first
+ // edit, so it never looks like an edit that was lost.
+ if (fresh) for (p.panes, 0..) |slot, id| if (slot == pane)
+ p.setMessage(id, "a copy of the terminal's text: Tab or B2 runs it; what the program draws next replaces it (Ctrl-b types to the program)");
return .{ .text = pane.ovl.?.text, .row0 = pane.ovl.?.row };
}
@@ -3072,8 +3077,8 @@ test "without pixels, or by the Petscii builtin, a terminal's image is glyph art
try std.testing.expectEqual(@as(usize, 0), imagePlaces(s).len);
try std.testing.expect(painted(s.at(tx, y)) and painted(s.at(tx + 1, y)));
try std.testing.expect(!painted(s.at(tx + 2, y)));
- // The tag says so, as an image pane's does.
- try std.testing.expect(std.mem.indexOf(u8, try tagline.tagPrefix(p, pane), " petscii:off") != null);
+ // The tag says what is drawn, glyph art, as an image pane's does.
+ try std.testing.expect(std.mem.indexOf(u8, try tagline.tagPrefix(p, pane), " petscii:on") != null);
// Pixels where they can be drawn; the builtin flips the pane to glyphs
// and back.