aboutsummaryrefslogtreecommitdiff
path: root/vendor/libghostty-vt/src/config/key.zig
diff options
context:
space:
mode:
authorCan Celik <ogulcancelik@gmail.com>2026-09-10 21:51:57 +0300
committerGitHub <noreply@github.com>2026-09-10 21:51:57 +0300
commit425c86179791cd32e2d4ce0ae7f269940b4b0663 (patch)
treee52c4383a6d69216cbe2a32638bf90841d7e2189 /vendor/libghostty-vt/src/config/key.zig
parent90e947a6e26e02f10ec7f1694c4eb5b78a86406b (diff)
chore: upgrade libghostty and preserve terminal behavior (#3906)
Diffstat (limited to 'vendor/libghostty-vt/src/config/key.zig')
-rw-r--r--vendor/libghostty-vt/src/config/key.zig27
1 files changed, 12 insertions, 15 deletions
diff --git a/vendor/libghostty-vt/src/config/key.zig b/vendor/libghostty-vt/src/config/key.zig
index 5709e207..1d15c937 100644
--- a/vendor/libghostty-vt/src/config/key.zig
+++ b/vendor/libghostty-vt/src/config/key.zig
@@ -6,29 +6,26 @@ const Config = @import("Config.zig");
/// amongst other things.
pub const Key = key: {
const field_infos = std.meta.fields(Config);
- var enumFields: [field_infos.len]std.builtin.Type.EnumField = undefined;
+ var names: [field_infos.len][]const u8 = undefined;
+ var raw_values: [field_infos.len]comptime_int = undefined;
var i: usize = 0;
- for (field_infos) |field| {
+ for (field_infos, &names, &raw_values) |field, *name, *raw| {
// Ignore fields starting with "_" since they're internal and
// not copied ever.
if (field.name[0] == '_') continue;
- enumFields[i] = .{
- .name = field.name,
- .value = i,
- };
+ name.* = field.name;
+ raw.* = i;
i += 1;
}
- var decls = [_]std.builtin.Type.Declaration{};
- break :key @Type(.{
- .@"enum" = .{
- .tag_type = std.math.IntFittingRange(0, field_infos.len - 1),
- .fields = enumFields[0..i],
- .decls = &decls,
- .is_exhaustive = true,
- },
- });
+ const TagInt = std.math.IntFittingRange(0, field_infos.len - 1);
+ var values: [i]TagInt = undefined;
+ for (raw_values[0..i], &values) |raw, *val| {
+ val.* = raw;
+ }
+
+ break :key @Enum(TagInt, .exhaustive, names[0..i], &values);
};
/// Returns the value type for a key