diff options
| author | Borja Clemente <borja.clemente@gmail.com> | 2023-12-17 14:22:38 +0100 |
|---|---|---|
| committer | Borja Clemente <borja.clemente@gmail.com> | 2023-12-17 16:19:22 +0100 |
| commit | 646e3c365c8e481b9c003fa5e5dab71a3ec8eb0f (patch) | |
| tree | d0f321f635fcd68f990c052ad6cdab8bd776e23b /src/App.zig | |
| parent | 5eea79ad0d2fdca12145d8f838db9ec6a6ad2422 (diff) | |
Add settings shortcut on MacOS
- Settings shortcut opens the config file in the default editor.
Signed-off-by: Borja Clemente <borja.clemente@gmail.com>
Diffstat (limited to 'src/App.zig')
| -rw-r--r-- | src/App.zig | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/App.zig b/src/App.zig index c1917f79b..99949d9e1 100644 --- a/src/App.zig +++ b/src/App.zig @@ -186,6 +186,7 @@ fn drainMailbox(self: *App, rt_app: *apprt.App) !void { log.debug("mailbox message={s}", .{@tagName(message)}); switch (message) { .reload_config => try self.reloadConfig(rt_app), + .open_config => try self.openConfig(rt_app), .new_window => |msg| try self.newWindow(rt_app, msg), .close => |surface| try self.closeSurface(surface), .quit => try self.setQuit(), @@ -196,6 +197,12 @@ fn drainMailbox(self: *App, rt_app: *apprt.App) !void { } } +pub fn openConfig(self: *App, rt_app: *apprt.App) !void { + _ = self; + log.debug("opening configuration", .{}); + try rt_app.openConfig(); +} + pub fn reloadConfig(self: *App, rt_app: *apprt.App) !void { log.debug("reloading configuration", .{}); if (try rt_app.reloadConfig()) |new| { @@ -274,6 +281,9 @@ pub const Message = union(enum) { /// all the active surfaces. reload_config: void, + // Open the configuration file + open_config: void, + /// Create a new terminal window. new_window: NewWindow, |
