mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-07-18 23:21:22 +00:00
ghosttyKit: add ghostty_config_load_file
This commit is contained in:
@@ -1024,6 +1024,7 @@ ghostty_config_t ghostty_config_new();
|
||||
void ghostty_config_free(ghostty_config_t);
|
||||
ghostty_config_t ghostty_config_clone(ghostty_config_t);
|
||||
void ghostty_config_load_cli_args(ghostty_config_t);
|
||||
void ghostty_config_load_file(ghostty_config_t, const char*);
|
||||
void ghostty_config_load_default_files(ghostty_config_t);
|
||||
void ghostty_config_load_recursive_files(ghostty_config_t);
|
||||
void ghostty_config_finalize(ghostty_config_t);
|
||||
|
||||
@@ -65,6 +65,15 @@ export fn ghostty_config_load_default_files(self: *Config) void {
|
||||
};
|
||||
}
|
||||
|
||||
/// Load the configuration from a specific file path.
|
||||
/// The path must be null-terminated.
|
||||
export fn ghostty_config_load_file(self: *Config, path: [*:0]const u8) void {
|
||||
const path_slice = std.mem.span(path);
|
||||
self.loadFile(state.alloc, path_slice) catch |err| {
|
||||
log.err("error loading config from file path={s} err={}", .{ path_slice, err });
|
||||
};
|
||||
}
|
||||
|
||||
/// Load the configuration from the user-specified configuration
|
||||
/// file locations in the previously loaded configuration. This will
|
||||
/// recursively continue to load up to a built-in limit.
|
||||
|
||||
Reference in New Issue
Block a user