From 42c0524b94d67caebbf71cd8a82d7690380195fa Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Mon, 27 Jul 2026 01:03:46 -0300 Subject: trim the taglines: image renderer toggles and Colors/Crt become leader-only MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The image tag spelled out `Petscii Ascii` and actOnSelection matched those words by hand before the builtin dispatch. They are three real Builtins now (SPC t p/l/a), so the by-word matching is gone, the tag is a plain `img Del`, and with nothing live left in it the image early-returns in curTail, enterTagEdit and the tag-click guard go too — an image tag edits like every other pane's. Colors and Crt leave the topbar for SPC t c / SPC t r: set-once display switches should not spend width in a bar you read every frame. NextColor stays, it is the one you cycle repeatedly. Both remain full builtins. The snap scripts that clicked those words now press the leader instead, and images.snap finally exercises the palette and ascii toggles for real: its old clicks at x=57 landed on the neighbouring shell's tag, so that toggle had never been covered. The test PPM grew to 512x512 with LCG noise so the ASCII bitmaps actually win cells and dropping them visibly changes the art. --- test/snapshot.zig | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'test/snapshot.zig') diff --git a/test/snapshot.zig b/test/snapshot.zig index 5417530d..f1ebd941 100644 --- a/test/snapshot.zig +++ b/test/snapshot.zig @@ -168,15 +168,26 @@ fn runScript(arena: std.mem.Allocator, exe_z: [:0]const u8, script_path: []const for (1..n + 1) |i| try buf.appendSlice(arena, try std.fmt.allocPrint(arena, "line {d}\n", .{i})); try eh.writeFile(try arena.dupeZ(u8, name), buf.items); } else if (std.mem.eql(u8, cmd, "ppmdiag")) { - // the 64x64 diagonal-split test PPM (white/blue) from the old e2e + // The diagonal-split test PPM from the old e2e (white over blue), + // grown to 512x512 with the white half filled by a fixed LCG + // noise. Both halves are load-bearing: the clean edge is what the + // block/sextant glyphs match exactly, the noise is fine enough + // (one source pixel per matcher subcell at this size) that the + // ASCII bitmaps win instead — so the Ascii toggle visibly changes + // the art, which a 64x64 image cannot show (its cells average + // down to flat color and a block always wins). const name = tok.next() orelse return error.BadScript; var ppm: std.ArrayList(u8) = .empty; - try ppm.appendSlice(arena, "P6\n64 64\n255\n"); + try ppm.appendSlice(arena, "P6\n512 512\n255\n"); + var seed: u64 = 12345; var py: usize = 0; - while (py < 64) : (py += 1) { + while (py < 512) : (py += 1) { var px: usize = 0; - while (px < 64) : (px += 1) - try ppm.appendSlice(arena, if (px + py < 64) &[_]u8{ 255, 255, 255 } else &[_]u8{ 0, 0, 255 }); + while (px < 512) : (px += 1) { + seed = seed *% 1103515245 +% 12345; + const v: u8 = @truncate(seed >> 16); + try ppm.appendSlice(arena, if (px + py < 512) &[_]u8{ v, v, v } else &[_]u8{ 0, 0, 255 }); + } } try eh.writeFile(try arena.dupeZ(u8, name), ppm.items); } else if (std.mem.eql(u8, cmd, "dirmk")) { -- cgit v1.3