feat: update config loader to support current flow editor configuration files

This commit is contained in:
CJ van den Berg 2025-04-25 09:45:36 +02:00
parent 9b3f6153da
commit 4afe325669
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
3 changed files with 155 additions and 44 deletions

View file

@ -13,6 +13,11 @@ var lang_override: ?[]const u8 = null;
var lang_default: []const u8 = "conf";
const no_highlight = std.math.maxInt(usize);
const builtin = @import("builtin");
pub const std_options: std.Options = .{
.log_level = if (builtin.mode == .Debug) .info else .err,
};
pub fn main() !void {
const params = comptime clap.parseParamsComptime(
\\-h, --help Display this help and exit.
@ -72,8 +77,8 @@ pub fn main() !void {
if (res.args.color == 0 and !stdout_file.supportsAnsiEscapeCodes())
return plain_cat(res.positionals[0]);
var conf_buf: ?[]const u8 = null;
const conf = config_loader.read_config(a, &conf_buf);
const conf, const conf_bufs = config_loader.read_config(a);
defer config_loader.free_config(a, conf_bufs);
const theme_name = if (res.args.theme) |theme| theme else conf.theme;
const limit_lines = res.args.limit;