refactor: rename keybind inherit setting

This commit is contained in:
CJ van den Berg 2024-12-01 23:28:11 +01:00
parent 264c6ca54b
commit 71a821aad6
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
2 changed files with 3 additions and 3 deletions

View file

@ -2,7 +2,7 @@
"settings": {
"init_command": ["enter_helix_mode"],
"deinit_command": ["exit_helix_mode"],
"fallback": "vim"
"inherit": "vim"
},
"normal": {
"syntax": "vim",

View file

@ -206,13 +206,13 @@ const Namespace = struct {
const JsonSettings = struct {
init_command: ?[]const std.json.Value = null,
deinit_command: ?[]const std.json.Value = null,
fallback: ?[]const u8 = null,
inherit: ?[]const u8 = null,
};
const parsed = try std.json.parseFromValue(JsonSettings, allocator, settings_value, .{
.ignore_unknown_fields = true,
});
defer parsed.deinit();
self.fallback = if (parsed.value.fallback) |fallback| try get_or_load_namespace(fallback) else null;
self.fallback = if (parsed.value.inherit) |fallback| try get_or_load_namespace(fallback) else null;
if (parsed.value.init_command) |cmd| self.init_command = try Command.load(allocator, cmd);
if (parsed.value.deinit_command) |cmd| self.deinit_command = try Command.load(allocator, cmd);
}