From 425c86179791cd32e2d4ce0ae7f269940b4b0663 Mon Sep 17 00:00:00 2001 From: Can Celik Date: Thu, 10 Sep 2026 21:51:57 +0300 Subject: chore: upgrade libghostty and preserve terminal behavior (#3906) --- vendor/libghostty-vt/src/config/conditional.zig | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'vendor/libghostty-vt/src/config/conditional.zig') diff --git a/vendor/libghostty-vt/src/config/conditional.zig b/vendor/libghostty-vt/src/config/conditional.zig index fdc285a2..e1a78792 100644 --- a/vendor/libghostty-vt/src/config/conditional.zig +++ b/vendor/libghostty-vt/src/config/conditional.zig @@ -39,18 +39,16 @@ pub const State = struct { /// An enum of the available conditional configuration keys. pub const Key = key: { const stateInfo = @typeInfo(State).@"struct"; - var fields: [stateInfo.fields.len]std.builtin.Type.EnumField = undefined; - for (stateInfo.fields, 0..) |field, i| fields[i] = .{ - .name = field.name, - .value = i, - }; + const TagInt = std.math.IntFittingRange(0, stateInfo.fields.len - 1); + var names: [stateInfo.fields.len][]const u8 = undefined; + var values: [stateInfo.fields.len]TagInt = undefined; - break :key @Type(.{ .@"enum" = .{ - .tag_type = std.math.IntFittingRange(0, fields.len - 1), - .fields = &fields, - .decls = &.{}, - .is_exhaustive = true, - } }); + for (stateInfo.fields, &names, &values, 0..) |field, *name, *v, i| { + name.* = field.name; + v.* = @intCast(i); + } + + break :key @Enum(TagInt, .exhaustive, &names, &values); }; /// A single conditional that can be true or false. -- cgit v1.2.3