From c7b9d3f317ecf604a61f5d92cde90ecdd17a1831 Mon Sep 17 00:00:00 2001 From: RadsammyT Date: Mon, 23 Mar 2026 14:59:44 -0400 Subject: [PATCH] migrator.zig: CustomCommands > custom + add unicode ID in comment --- src/config/migrator.zig | 14 +++++++------- src/main.zig | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/config/migrator.zig b/src/config/migrator.zig index eccf9ac..8149c01 100644 --- a/src/config/migrator.zig +++ b/src/config/migrator.zig @@ -16,7 +16,7 @@ const ini = ly_core.ini; const Config = @import("Config.zig"); const OldSave = @import("OldSave.zig"); const SavedUsers = @import("SavedUsers.zig"); -const CustomCommands = @import("custom.zig"); +const custom = @import("custom.zig"); const color_properties = [_][]const u8{ "bg", @@ -166,10 +166,10 @@ pub fn configFieldHandler(_: std.mem.Allocator, field: ini.IniField) ?ini.IniFie if (std.mem.startsWith(u8, field.header, "cmd:")) { const key = field.header["cmd:".len..]; const keyZ = temporary_allocator.dupe(u8, key) catch ""; - if (!CustomCommands.binds.contains(key)) { - CustomCommands.binds.put(keyZ, .{}) catch {}; + if (!custom.binds.contains(key)) { + custom.binds.put(keyZ, .{}) catch {}; } - if (CustomCommands.binds.getPtr(keyZ)) |command| { + if (custom.binds.getPtr(keyZ)) |command| { if (std.mem.eql(u8, field.key, "name")) { command.name = temporary_allocator.dupe(u8, field.value) catch ""; } @@ -182,10 +182,10 @@ pub fn configFieldHandler(_: std.mem.Allocator, field: ini.IniField) ?ini.IniFie if (std.mem.startsWith(u8, field.header, "lbl:")) { const key = field.header["lbl:".len..]; const keyZ = temporary_allocator.dupe(u8, key) catch ""; - if (!CustomCommands.labels.contains(keyZ)) { - CustomCommands.labels.put(keyZ, .{ .name = keyZ }) catch {}; + if (!custom.labels.contains(keyZ)) { + custom.labels.put(keyZ, .{ .name = keyZ }) catch {}; } - if (CustomCommands.labels.getPtr(keyZ)) |label| { + if (custom.labels.getPtr(keyZ)) |label| { if (std.mem.eql(u8, field.key, "cmd")) { label.cmd = temporary_allocator.dupe(u8, field.value) catch ""; } diff --git a/src/main.zig b/src/main.zig index 89f9059..1466aa5 100644 --- a/src/main.zig +++ b/src/main.zig @@ -1769,7 +1769,7 @@ fn updateCustomInfo(lbl: *Label, ptr: *anyopaque) !void { _ = try c.wait(); // Sometimes, the output of a command would have an unprintable character at - // the end of its output, causing '�' to appear in its place. Here, we check + // the end of its output, causing '�' (U+FFFD) to appear in its place. Here, we check // if this is the case and remove it. if (stdout.items.len != 0 and !std.ascii.isPrint(stdout.items[stdout.items.len - 1])) { _ = stdout.pop();