From 2367ed34beccf3f2f1b8bbf6b8a171f50933d7a1 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 5 Nov 2026 00:08:16 -0300 Subject: config, exec, look: Placement, BootShell, LookWord, DirLook and DiffLook go, with what each kept of pardes before it took acme's ways (exec's pardesPlace, atFoot, belowParent, pardesDoc and evictLonePristineTty with mouse.zig's call, layout's splitParent and columnFitsHalves that only they called, look's ls in a terminal for a directory, the word and patch looks' other branches, the SPC c p key, their Help and builtins-JSON rows, their lines in docs/typ and a changelog line), and the tests of them: Dir.zig's "DirLook terminal: a look at a directory opens a terminal there, no pane listing it", pardes.zig's "first document fallback splits like Term from the originating pane", "first document keeps its originating shell and only opens a column when it fits", "BootShell keep leaves the untouched boot shell a dragged document joins; replace closes it" and "a Look on a directory does not type ls into an occupied terminal", keys.zig's "keys: SPC j n and SPC j p walk on from the place a Look's +Search listing chose, its keyboard left in the file", look_and_exec.zig's "look-and-exec: a second LookWord list look in a directory refills its +Search rather than stacking another", placement.zig's "placement: Placement pardes puts a new pane right under the asking one, and bare it steps back to acme", output.zig's "LookNext/LookPrev keeps the result output a Look chose through a no-match answer, and a stale serial once it is deleted", and the snapshot scripts that turned them on (cmdword, doccol, look-dir, lookpanes, rsearch, splitparent, ttylook); the Del question's test makes its middle panes the acme way, a New at the column's foot, and the others that turned one on for their layout run without it Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge --- test/output.zig | 55 ------------------------------------------------------- 1 file changed, 55 deletions(-) (limited to 'test/output.zig') diff --git a/test/output.zig b/test/output.zig index c476af28..9fba1a77 100644 --- a/test/output.zig +++ b/test/output.zig @@ -793,61 +793,6 @@ test "LookNext/LookPrev selects one output location per row and opens nothing" { try std.testing.expectEqual(panes.Output.Grain.word, panes.Output.grain(p.panes[p.active].?.file.?.output)); } -test "LookNext/LookPrev keeps the result output a Look chose through a no-match answer, and a stale serial once it is deleted" { - if (platform == .web) return; - var tmp = std.testing.tmpDir(.{}); - defer tmp.cleanup(); - try tmp.dir.writeFile(std.testing.io, .{ - .sub_path = "look-owner.txt", - .data = "alpha target\nbeta target\ngamma target\n", - }); - var path_buf: [256]u8 = undefined; - const path = try std.fmt.bufPrint(&path_buf, ".zig-cache/tmp/{s}/look-owner.txt", .{tmp.sub_path}); - const p = try Pardes.init(std.testing.allocator, .{ .file = path, .cols = 80, .rows = 24 }); - defer p.deinit(); - p.locations_config.layout = .@"inline"; - p.settings.look_word = .list; // the +Search listing is what is walked - - try std.testing.expect(p.executeBuiltinLine(0, "Look target")); - const rid = p.panes[0].?.search_pane orelse return error.MissingResults; - const results = p.panes[rid].?; - const first = results.body.cur_row; - try std.testing.expectEqual(@as(usize, 0), p.active); - try std.testing.expect(results.look_at != null); - try std.testing.expectEqual(results.serial, p.look_walk_owner orelse return error.MissingLookOwner); - - // The walk on and back from it is test/behaviour/keys.zig's; what is - // left needs answers put in by fillResults. - // A later no-match answer has no position to resume and therefore cannot - // steal the provenance established by the Look above. - const owner = results.serial; - const dir = std.fs.path.dirname(path) orelse "."; - try panes.Output.fillResults( - p, - 0, - dir, - .search, - "no-such-result", - try p.gpa.dupe(u8, ""), - null, - ); - try std.testing.expectEqual(owner, p.look_walk_owner.?); - lookKey(p, 'n'); - try std.testing.expectEqual(rid, p.active); - try std.testing.expectEqual(first + 1, results.body.cur_row); - - // Emptying the owner itself keeps its identity as the ring's starting - // point. Deleting it then leaves a stale serial, never an id that can bind - // to the unrelated pane subsequently allocated in the same slot. - try panes.Output.fillResults(p, 0, dir, .search, "target", try p.gpa.dupe(u8, ""), null); - try std.testing.expectEqual(owner, p.look_walk_owner.?); - try std.testing.expect(p.executeBuiltinLine(rid, "Del")); - try std.testing.expect(p.paneBySerial(owner) == null); - const replacement = try p.newShell(rid, ""); - try std.testing.expect(replacement.serial != owner); - try std.testing.expect(p.paneBySerial(owner) == null); -} - test "LookPrev exactly reverses LookNext across output panes and the ring seam" { if (platform == .web) return; var cwd_buf: [4096]u8 = undefined; -- cgit v1.3