From 18d89dcedaed1f8437799621675e88ca47d7cdc1 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Sat, 24 Oct 2026 10:29:10 -0300 Subject: Search converge 2/6: a pane's places, every match or listed place tinted and ticked on the rail, n/N stepping them silently, shifted by an edit rather than searched again --- src/draw.zig | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/draw.zig') diff --git a/src/draw.zig b/src/draw.zig index 93a78090..5c1844bb 100644 --- a/src/draw.zig +++ b/src/draw.zig @@ -46,6 +46,7 @@ const NOTICE_LAYER_BASE = pardes.NOTICE_LAYER_BASE; /// painters below and every shell read these rectangles. pub fn place(p: *Pardes, s: *Surface) void { s.nregions = 0; + s.nrail_ticks = 0; s.addRegion(.{ .kind = .page, .rect = .{ .x = 0, .y = 0, .w = s.cols, .h = s.rows } }); for (&p.panes, 0..) |*slot, id| { const pane = slot.* orelse continue; @@ -89,6 +90,7 @@ pub fn place(p: *Pardes, s: *Surface) void { rail.thumb_span = @as(f32, @floatFromInt(@max(1, sb.len))) / @as(f32, @floatFromInt(total)); } s.addRegion(rail); + if (body_h > 0 and pane.image == null) pane.places.addTicks(p, pane, s, owner); // Each notice a chip at the right edge, one to a row in the order // collectNotices chose, as wide as its own message and no wider, so // the text beneath the rest of the row keeps reading as the file. @@ -566,6 +568,8 @@ pub fn render(p: *Pardes, arena: std.mem.Allocator) !*Surface { .tag_fg = chrome.tag_fg, .scroll_track = chrome.scroll_track, .scroll_thumb = chrome.scroll_thumb, + .match_tick = chrome.search_bg, + .match_current = p.theme().fg orelse chrome.tag_fg, .accent = chrome.box, .sel_fg = p.theme().sel_fg, .sel_bg = p.theme().sel_bg, @@ -973,6 +977,13 @@ fn renderPane(p: *Pardes, s: *Surface, arena: std.mem.Allocator, pane: *Pane, r: } try body_layer.joinBody(p, s, arena, pane, r, id, active, rail.*); + // A query's places' ticks, each in the track's cell of its row: chrome, + // painted with the rail (a pixel shell draws its own from the same list). + for (s.rail_ticks[0..s.nrail_ticks]) |tick| { + if (tick.owner != id or rail.rect.h == 0) continue; + const row: u16 = @intCast(@min(rail.rect.h - 1, @as(usize, tick.at) * rail.rect.h / panes.Places.tick_scale)); + s.fill(rail.rect.x, rail.rect.y + row, 1, 1, .{ .bg = .{ .rgb = if (tick.current) s.chrome.match_current else s.chrome.match_tick } }); + } } /// The workspace and column tags: each line a tag layer, and the grid's -- cgit v1.3