This commit is contained in:
Mitchell Hashimoto
2025-03-12 10:04:13 -07:00
parent 2408d4c6a9
commit 43467690f3
6 changed files with 9 additions and 7 deletions

View File

@ -34,7 +34,7 @@ pub const WindowPaddingColor = Config.WindowPaddingColor;
// Alternate APIs
pub const CAPI = @import("config/CAPI.zig");
pub const Wasm = if (!builtin.target.isWasm()) struct {} else @import("config/Wasm.zig");
pub const Wasm = if (!builtin.target.cpu.arch.isWasm()) struct {} else @import("config/Wasm.zig");
test {
@import("std").testing.refAllDecls(@This());

View File

@ -34,6 +34,8 @@ pub const Key = key: {
/// Returns the value type for a key
pub fn Value(comptime key: Key) type {
const field = comptime field: {
@setEvalBranchQuota(100_000);
const fields = std.meta.fields(Config);
for (fields) |field| {
if (@field(Key, field.name) == key) {

View File

@ -34,7 +34,7 @@ pub fn HashMap(
return struct {
const Self = @This();
const Map = std.HashMapUnmanaged(K, *Queue.Node, Context, max_load_percentage);
const Queue = std.TailQueue(KV);
const Queue = std.DoublyLinkedList(KV);
/// Map to maintain our entries.
map: Map,

View File

@ -51,7 +51,7 @@ pub const FlagStack = struct {
// could send a huge number of pop commands to waste cpu.
if (n >= self.flags.len) {
self.idx = 0;
self.flags = .{.{}} ** len;
self.flags = .{Flags{}} ** len;
return;
}

View File

@ -343,7 +343,7 @@ pub const Set = RefCountedSet(
test "Set basic usage" {
const testing = std.testing;
const alloc = testing.allocator;
const layout = Set.layout(16);
const layout: Set.Layout = .init(16);
const buf = try alloc.alignedAlloc(u8, Set.base_align, layout.total_size);
defer alloc.free(buf);
@ -397,5 +397,5 @@ test "Set basic usage" {
test "Set capacities" {
// We want to support at least this many styles without overflowing.
_ = Set.layout(16384);
_ = Set.Layout.init(16384);
}

View File

@ -233,10 +233,10 @@ test "encode" {
try src.encode(buf_stream.writer());
const expected =
"ghostty|xterm-ghostty|Ghostty\n" ++
"ghostty|xterm-ghostty|Ghostty,\n" ++
"\tam,\n" ++
"\tccc@,\n" ++
"\tcolors#256,\n" ++
"\tbel=^G,\n\n";
"\tbel=^G,\n";
try std.testing.expectEqualStrings(@as([]const u8, expected), buf_stream.getWritten());
}