apprt/glfw: implement openconfig

This commit is contained in:
Mitchell Hashimoto
2023-12-18 08:20:29 -08:00
parent 9c0de96c79
commit b711ac8a42

View File

@ -20,6 +20,7 @@ const Renderer = renderer.Renderer;
const apprt = @import("../apprt.zig");
const CoreApp = @import("../App.zig");
const CoreSurface = @import("../Surface.zig");
const configpkg = @import("../config.zig");
const Config = @import("../config.zig").Config;
// Get native API access on certain platforms so we can do more customization.
@ -127,6 +128,11 @@ pub const App = struct {
glfw.postEmptyEvent();
}
/// Open the configuration in the system editor.
pub fn openConfig(self: *App) !void {
try configpkg.edit.open(self.app.alloc);
}
/// Reload the configuration. This should return the new configuration.
/// The old value can be freed immediately at this point assuming a
/// successful return.