summaryrefslogtreecommitdiff
path: root/src/web.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-22 09:50:43 -0300
committerGabriel Schneider <[email protected]>2026-10-22 10:03:24 -0300
commita8b457a306a4442975210bcac3f04b56513c61c3 (patch)
tree6e2026ecb15da2fb919a0202f5d8b38e3b36a595 /src/web.zig
parenta8a1499bdffffc5b6919e24ec957e92fabaf003b (diff)
parent7e9d2c4169245072265b483ffaa6aa05f23f08d3 (diff)
downloadpardes-a8b457a306a4442975210bcac3f04b56513c61c3.tar.gz
pardes-a8b457a306a4442975210bcac3f04b56513c61c3.zip
Merge: Def/Refs, the diff viewer, Helix n/N, Callstack, Zig 0.17, Window mode and the terminal cwd fix onto 0.24
The docs keep both sides: 0.24's Ctrl-i fallbacks and typed ls with this line's Window mode, raw Esc and Helix n/N wording. The CHANGELOG's unreleased entries go above 0.24, Def/Refs and the context rows among them. cheatsheet-a4.pdf rendered again; .scratch/ ignored. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/web.zig')
-rw-r--r--src/web.zig32
1 files changed, 17 insertions, 15 deletions
diff --git a/src/web.zig b/src/web.zig
index fed2ba5a..f89aa7e9 100644
--- a/src/web.zig
+++ b/src/web.zig
@@ -258,18 +258,20 @@ fn mouseWithHit(button_arg: u32, kind_arg: u32, col_arg: u32, row_arg: u32, mods
3 => .drag,
else => return,
};
- s.core.update(.{ .mouse = .{
- .body_hit = hit,
- .tag_hit = tag_hit,
- .button = button,
- .kind = kind,
- .col = @intCast(@min(col_arg, std.math.maxInt(u16))),
- .row = @intCast(@min(row_arg, std.math.maxInt(u16))),
- .ctrl = mods & 1 != 0,
- // Alt-click is B2 and Cmd/Super-click B3 (mouse.emulateButton).
- .alt = mods & 2 != 0,
- .super = mods & 8 != 0,
- } });
+ s.core.update(.{
+ .mouse = .{
+ .body_hit = hit,
+ .tag_hit = tag_hit,
+ .button = button,
+ .kind = kind,
+ .col = @intCast(@min(col_arg, std.math.maxInt(u16))),
+ .row = @intCast(@min(row_arg, std.math.maxInt(u16))),
+ .ctrl = mods & 1 != 0,
+ // Alt-click is B2 and Cmd/Super-click B3 (mouse.emulateButton).
+ .alt = mods & 2 != 0,
+ .super = mods & 8 != 0,
+ },
+ });
}
export fn pardes_touch_scroll(delta: f32) void {
@@ -347,7 +349,7 @@ export fn pardes_tag_layer_value(index: u32, field: u32) u32 {
if (layer.rows == 0) return 0;
return switch (field) {
0 => layer.cols,
- 1 => @intFromEnum(layer.kind),
+ 1 => @backingInt(layer.kind),
2 => layer.id,
3 => layer.serial,
4 => layer.viewport.x,
@@ -421,7 +423,7 @@ export fn pardes_row_metrics(body_w: u16, body_h: u16, tagline_w: u16, tagline_h
export fn pardes_pointer_shape() u32 {
const s = &(state orelse return 0);
- return @intFromEnum(s.core.surface.pointer_shape);
+ return @backingInt(s.core.surface.pointer_shape);
}
export fn pardes_cursor_y() i32 {
@@ -557,6 +559,6 @@ fn encodeAttrs(style: pardes.CellStyle) u16 {
attrs |= @as(u16, @intFromBool(style.invisible)) << 5;
attrs |= @as(u16, @intFromBool(style.strikethrough)) << 6;
attrs |= @as(u16, @intFromBool(style.font_role == .tagline)) * attr_tagline;
- attrs |= @as(u16, @intFromEnum(style.ul)) << 8;
+ attrs |= @as(u16, @backingInt(style.ul)) << 8;
return attrs;
}