diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-17 00:38:41 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-17 12:15:01 -0300 |
| commit | 26929e67111e843db4ad27abb4f1341cf396158c (patch) | |
| tree | 8540497ac35231593742c17fb6df03ec0a16a76f /test/kitty.zig | |
| parent | 1d382a3ed42788e82301d0ce2a16ebc35c79046c (diff) | |
| download | pardes-26929e67111e843db4ad27abb4f1341cf396158c.tar.gz pardes-26929e67111e843db4ad27abb4f1341cf396158c.zip | |
Term: text through the interface, the editing of the copy back to the core: Term.scrollback and Term.scrollbackLen are its whole history as plain text (its body, Save), Term.textRows its rows as text with a prompt's own cells cut off (a plain Term.Rows), Term.viewport the rows its view shows, Term.promptPrefix how many bytes of a row are its prompt and Term.markRead says a step read them; the editing of the copy of a terminal's rows is the core's again, in edit.zig beside the text it edits: shellRows and the rows' cache (edit.RowsCache, edit.drawing), terminalLines (the rows with the copy spliced in), and in edit.zig's own flatSurface, editText, setEditText, pushUndo and undoStep the terminal's arms written out where they were dispatched to terminal.zig; the body's walk over the rows and the copy (BodyWalk) is body_layer.zig's, beside the bodyText it makes; screenTextAlloc, screenTextLen, cursorLines, flatSurface, editText, setEditText, pushUndo, undoStep and bodyText leave terminal.zig; nothing else changes
Diffstat (limited to 'test/kitty.zig')
| -rw-r--r-- | test/kitty.zig | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/test/kitty.zig b/test/kitty.zig index 4341677e..760d22be 100644 --- a/test/kitty.zig +++ b/test/kitty.zig @@ -19,7 +19,6 @@ const std = @import("std"); const pardes = @import("pardes"); const Pardes = pardes.Pardes; const config = pardes.config; -const terminal = pardes.panes.terminal; const gpa = std.testing.allocator; @@ -309,7 +308,7 @@ test "kitty: text around an APC prints, in the same read and split across reads" var r = try Rig.init(1); defer r.deinit(); r.feedSplit(0, "before" ++ apc("a=t,i=3,f=24,s=4,v=2,q=2", rgb_b64) ++ "after", step); - const text = try terminal.screenTextAlloc(r.pane(0), r.frame.allocator()); + const text = try pardes.Term.scrollback(r.pane(0).terminal, r.frame.allocator()); try std.testing.expect(std.mem.indexOf(u8, text, "beforeafter") != null); try std.testing.expect(r.hasImage(0, 3)); } @@ -643,7 +642,7 @@ test "kitty: an image follows its text when the shell scrolls, resizes and reflo // A narrower pane reflows the text; the image stays on its row. const pane = r.pane(0); pane.resizeGrid(40, pane.rows); - const text = try terminal.screenTextAlloc(pane, r.frame.allocator()); + const text = try pardes.Term.scrollback(pane.terminal, r.frame.allocator()); var row: usize = 0; var lines = std.mem.splitScalar(u8, text, '\n'); while (lines.next()) |line| : (row += 1) if (std.mem.startsWith(u8, line, "marker")) break; @@ -762,7 +761,7 @@ test "kitty: a cancelled (CAN, SUB) APC runs nothing, answers nothing, and the t r.feed(0, "after"); try std.testing.expect(!r.hasImage(0, 60)); try std.testing.expectEqualStrings("", try r.take(0)); - const text = try terminal.screenTextAlloc(r.pane(0), r.frame.allocator()); + const text = try pardes.Term.scrollback(r.pane(0).terminal, r.frame.allocator()); try std.testing.expect(std.mem.indexOf(u8, text, "after") != null); } } |
