fix: allow loading custom theme files up to 512Kb in size

closes #544
This commit is contained in:
CJ van den Berg 2026-03-31 20:58:54 +02:00
parent 310221bb26
commit cf7fc6af54
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -882,7 +882,10 @@ pub fn read_theme(allocator: std.mem.Allocator, theme_name: []const u8) ?[]const
const file_name = get_theme_file_name(theme_name) catch return null; const file_name = get_theme_file_name(theme_name) catch return null;
var file = std.fs.openFileAbsolute(file_name, .{ .mode = .read_only }) catch return null; var file = std.fs.openFileAbsolute(file_name, .{ .mode = .read_only }) catch return null;
defer file.close(); defer file.close();
return file.readToEndAlloc(allocator, 64 * 1024) catch null; return file.readToEndAlloc(allocator, 512 * 1024) catch |e| {
std.log.err("Error reading theme file: {t}", .{e});
return null;
};
} }
pub fn write_theme(theme_name: []const u8, content: []const u8) !void { pub fn write_theme(theme_name: []const u8, content: []const u8) !void {