diff options
| author | Can Celik <ogulcancelik@gmail.com> | 2026-09-10 21:51:57 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-10 21:51:57 +0300 |
| commit | 425c86179791cd32e2d4ce0ae7f269940b4b0663 (patch) | |
| tree | e52c4383a6d69216cbe2a32638bf90841d7e2189 /vendor/libghostty-vt/src/config/conditional.zig | |
| parent | 90e947a6e26e02f10ec7f1694c4eb5b78a86406b (diff) | |
chore: upgrade libghostty and preserve terminal behavior (#3906)
Diffstat (limited to 'vendor/libghostty-vt/src/config/conditional.zig')
| -rw-r--r-- | vendor/libghostty-vt/src/config/conditional.zig | 20 |
1 files changed, 9 insertions, 11 deletions
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. |
