From 5cc02232d522d5cd5a453caedd1e592ca20471ea Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 3 Nov 2026 17:09:53 -0300 Subject: test: eleven more of src/pardes.zig's tests through the 9P tree alone (test/behaviour/columns_and_tags, modes, tags, panes): a click past a column tag's text typing after it, a newline there a space and a long tag scrolled to its caret, Enter and Tab in a tag running the word under the cursor, Esc alternating two panes of a kind, Esc out of a column or the workspace tag, Shift-Esc out of every mode, a name typed into the tag's path pending past Esc, an unsaved file's tag its name alone, a question ended in the log when its pane closes, focus on a closed pane to the one taking its place; Session's cursor (/screen's); each checked to fail against a break (flatten keeping newlines, the header drawn unscrolled, Enter in a header a Look, Esc in normal mode not running Last, Esc in a header not leaving it, Shift-Esc leaving insert on, the first Esc on a drafted name dropping it, a dirty tag marked ' *', del_side left out of noteRetire's answer, removeColumn's focus to any pane) Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge --- test/session.zig | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test/session.zig') diff --git a/test/session.zig b/test/session.zig index c4ed0db2..f67f3b25 100644 --- a/test/session.zig +++ b/test/session.zig @@ -210,6 +210,16 @@ pub const Session = struct { const col = cols.next() orelse return error.NoColumn; return std.fmt.parseInt(u32, col[0..std.mem.indexOfScalar(u8, col, ':').?], 10); } + + /// Where /screen draws the cursor, column and row; null when it draws none. + pub fn cursor(s: *Session) !?struct { usize, usize } { + const json = try std.json.parseFromSliceLeaky(std.json.Value, s.arena.allocator(), try s.read("/screen"), .{}); + const c = switch (json.object.get("cursor").?) { + .object => |o| o, + else => return null, + }; + return .{ @intCast(c.get("x").?.integer), @intCast(c.get("y").?.integer) }; + } }; fn refusal(path: []const u8, r: Reply) error{Refused} { -- cgit v1.3