Prepare for Zig 0.17.0

Still requires Zig 0.16.x for now.

Signed-off-by: AnErrupTion <anerruption@disroot.org>
This commit is contained in:
AnErrupTion
2026-07-07 11:51:05 +02:00
parent 78c7c2e2e8
commit 5ccd91c132
7 changed files with 546 additions and 399 deletions

View File

@@ -19,7 +19,7 @@ pub fn build(b: *std.Build) void {
.optimize = optimize,
.enable_x11_support = enable_x11_support,
.fallback_uid_min = fallback_uid_min,
.fallback_uid_max = fallback_uid_max
.fallback_uid_max = fallback_uid_max,
});
mod.addImport("ly-core", ly_core.module("ly-core"));

View File

@@ -12,8 +12,8 @@
.hash = "N-V-__8AAAUXBQD6Fwpi9m0MBqWXFFaqW5l1lVrJC2Ynj7a-",
},
.translate_c = .{
.url = "git+https://codeberg.org/ziglang/translate-c#7a1a9fdc4ab00835748a6657ecbb835e3d5d45f7",
.hash = "translate_c-0.0.0-Q_BUWvP1BgCjAk6PWv5286tOlvzD9-X-NkuTzh0KxY0Q",
.url = "git+https://codeberg.org/ziglang/translate-c?ref=zig-0.16.x#6fe0ffc4549f15c5f2d9432c2b4460ba90ff85ac",
.hash = "translate_c-1.0.0-Q_BUWo_5BgD4flHdUhA31zOz0XvZk9k7lQv1ouzyNXj2",
},
},
.paths = .{

View File

@@ -578,9 +578,9 @@ fn parseKeybind(self: *TerminalBuffer, io: std.Io, keybind: []const u8) !keyboar
while (iterator.next()) |item| {
var found = false;
inline for (std.meta.fields(keyboard.Key)) |field| {
if (std.ascii.eqlIgnoreCase(field.name, item)) {
@field(key, field.name) = true;
inline for (comptime std.meta.fieldNames(keyboard.Key)) |name| {
if (std.ascii.eqlIgnoreCase(name, item)) {
@field(key, name) = true;
found = true;
break;
}

View File

@@ -113,14 +113,14 @@ pub const Key = packed struct {
pub fn getEnabledPrintableAscii(self: Key) ?u8 {
if (self.ctrl or self.alt) return null;
inline for (std.meta.fields(Key)) |field| {
if (field.name.len == 1 and std.ascii.isPrint(field.name[0]) and @field(self, field.name)) {
inline for (comptime std.meta.fieldNames(Key)) |name| {
if (name.len == 1 and std.ascii.isPrint(name[0]) and @field(self, name)) {
if (self.shift) {
if (!std.ascii.isAlphanumeric(field.name[0])) return null;
return std.ascii.toUpper(field.name[0]);
if (!std.ascii.isAlphanumeric(name[0])) return null;
return std.ascii.toUpper(name[0]);
}
return field.name[0];
return name[0];
}
}