diff --git a/src/config.zig b/src/config.zig index 4ea9038..c72f7d9 100644 --- a/src/config.zig +++ b/src/config.zig @@ -23,4 +23,4 @@ bottom_bar: []const u8 = "mode file log selection diagnostics keybind linenumber lsp_request_timeout: usize = 10, -config_files: []const u8 = "", +include_files: []const u8 = "", diff --git a/src/gui_config.zig b/src/gui_config.zig index d484d6e..ea65ca3 100644 --- a/src/gui_config.zig +++ b/src/gui_config.zig @@ -1,4 +1,4 @@ fontface: [] const u8 = "Cascadia Code", fontsize: f32 = 17.5, -config_files: []const u8 = "", +include_files: []const u8 = "", diff --git a/src/main.zig b/src/main.zig index 6e05388..83469bd 100644 --- a/src/main.zig +++ b/src/main.zig @@ -398,7 +398,7 @@ pub fn read_config(T: type, allocator: std.mem.Allocator) struct { T, [][]const const file_name = get_app_config_file_name(application_name, @typeName(T)) catch return .{ .{}, bufs }; var conf: T = .{}; read_config_file(T, allocator, &conf, &bufs, file_name); - read_nested_config_files(T, allocator, &conf, &bufs); + read_nested_include_files(T, allocator, &conf, &bufs); return .{ conf, bufs }; } @@ -428,12 +428,12 @@ fn read_json_config_file(T: type, allocator: std.mem.Allocator, conf: *T, bufs_: var field_name: []const u8 = undefined; if (!(try cbor.matchString(&iter, &field_name))) return error.InvalidConfig; inline for (@typeInfo(T).Struct.fields) |field_info| - if (comptime std.mem.eql(u8, "config_files", field_info.name)) { + if (comptime std.mem.eql(u8, "include_files", field_info.name)) { if (std.mem.eql(u8, field_name, field_info.name)) { var value: field_info.type = undefined; if (!(try cbor.matchValue(&iter, cbor.extract(&value)))) return error.InvalidConfig; - if (conf.config_files.len > 0) { - std.log.err("{s}: ignoring nested 'config_files' value '{s}'", .{ file_name, value }); + if (conf.include_files.len > 0) { + std.log.err("{s}: ignoring nested 'include_files' value '{s}'", .{ file_name, value }); } else { @field(conf, field_info.name) = value; } @@ -446,9 +446,9 @@ fn read_json_config_file(T: type, allocator: std.mem.Allocator, conf: *T, bufs_: } } -fn read_nested_config_files(T: type, allocator: std.mem.Allocator, conf: *T, bufs: *[][]const u8) void { - if (conf.config_files.len == 0) return; - var it = std.mem.splitScalar(u8, conf.config_files, std.fs.path.delimiter); +fn read_nested_include_files(T: type, allocator: std.mem.Allocator, conf: *T, bufs: *[][]const u8) void { + if (conf.include_files.len == 0) return; + var it = std.mem.splitScalar(u8, conf.include_files, std.fs.path.delimiter); while (it.next()) |path| read_config_file(T, allocator, conf, bufs, path); } diff --git a/src/tui/tui.zig b/src/tui/tui.zig index 60d1843..9939bb5 100644 --- a/src/tui/tui.zig +++ b/src/tui/tui.zig @@ -92,7 +92,7 @@ fn init(allocator: Allocator) !*Self { conf.input_mode = try allocator.dupe(u8, conf.input_mode); conf.top_bar = try allocator.dupe(u8, conf.top_bar); conf.bottom_bar = try allocator.dupe(u8, conf.bottom_bar); - conf.config_files = try allocator.dupe(u8, conf.config_files); + conf.include_files = try allocator.dupe(u8, conf.include_files); if (build_options.gui) conf.enable_terminal_cursor = false; const frame_rate: usize = @intCast(tp.env.get().num("frame-rate"));