summaryrefslogtreecommitdiff
path: root/src/draw.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-29 22:59:43 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:17 -0300
commit6d148bb9c433814835935ead30020e43781b7f03 (patch)
tree49e42dbbbff64119ead447598a896a69e638e061 /src/draw.zig
parentb1485c97b493f7eaf65c6afdfb82e3065306b8fe (diff)
parentd4960472375ea68f709c56a677d8a37571419ff7 (diff)
downloadpardes-6d148bb9c433814835935ead30020e43781b7f03.tar.gz
pardes-6d148bb9c433814835935ead30020e43781b7f03.zip
Release Pardes 0.6
Merge: audit top-five cuts + tag sweeps + Config/DumpConfig (on the audit bug fixes C9, C2). Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/draw.zig')
-rw-r--r--src/draw.zig26
1 files changed, 24 insertions, 2 deletions
diff --git a/src/draw.zig b/src/draw.zig
index ad24153f..0ea0b35e 100644
--- a/src/draw.zig
+++ b/src/draw.zig
@@ -1109,8 +1109,9 @@ fn renderHeaderLayer(p: *Pardes, arena: std.mem.Allocator, layer: *pardes.Layer,
// The word under the pointer, a Look or Exec target: on a header even
// while it is edited, on a notice, and on the grid's copy of either
// (joined from this); not on a column a carried column's pointer is
- // aiming at a place over.
- const hovered = p.pointer_inside and !(kind == .column and p.drag == .column_move);
+ // aiming at a place over; nor under a held middle or right sweep,
+ // which paints what it sweeps instead.
+ const hovered = p.pointer_inside and !(kind == .column and p.drag == .column_move) and p.header_sweep == null;
if (hovered) {
const tag_hit = p.pointer_tag_hit;
const col: ?usize = if (tag_hit) |pointer|
@@ -1141,6 +1142,27 @@ fn renderHeaderLayer(p: *Pardes, arena: std.mem.Allocator, layer: *pardes.Layer,
const asking = if (p.panes[p.active]) |active| active.prompt != .none else false;
if (!asking and t.cur_row == line + p.header_top and caret < columns) layer.cursor = .{ .x = @intCast(caret), .y = line, .bar = t.mode == .insert };
}
+ // A middle or right sweep held over this header, tinted by its
+ // button as a pane tag's is.
+ if (p.header_sweep) |sweep| if (sweep.column(p)) |column| {
+ const mine = switch (kind) {
+ .workspace => column == null,
+ .column => column == id,
+ .pane, .notice, .body => false,
+ };
+ const swept = sweep.span(text.len);
+ const start = modal.lineStartOffset(text, index + top);
+ const end = start + shown.len;
+ if (mine and swept.lo < swept.hi and swept.hi > start and swept.lo < end) {
+ const button = @intFromEnum(sweep.button);
+ var col = panes.File.rawDisplayCol(shown, @max(swept.lo, start) - start) -| scroll;
+ const stop = panes.File.rawDisplayCol(shown, @min(swept.hi, end) - start) -| scroll;
+ while (col < stop and col < columns) : (col += 1) {
+ surface.at(@intCast(col), 0).style.bg = .{ .rgb = body_layer.buttonTints(p.theme())[button] };
+ surface.at(@intCast(col), 0).style.fg = .{ .rgb = body_layer.buttonInks(p.theme())[button] };
+ }
+ }
+ } else |_| {};
}
}