feat: add command toggle_color_scheme and flow mode keybind (alt+f11)

This commit is contained in:
CJ van den Berg 2025-09-30 14:22:28 +02:00
parent fbe6a6e5ea
commit cb389888e5
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
2 changed files with 10 additions and 0 deletions

View file

@ -28,6 +28,7 @@
["f9", "theme_prev"],
["f10", "theme_next"],
["f11", "toggle_panel"],
["alt+f11", "toggle_color_scheme"],
["f12", "toggle_inputview"],
["alt+!", "run_task"],
["ctrl+1", "add_task"],

View file

@ -908,6 +908,15 @@ const cmds = struct {
}
pub const toggle_highlight_columns_meta: Meta = .{ .description = "Toggle highlight columns" };
pub fn toggle_color_scheme(self: *Self, _: Ctx) Result {
self.color_scheme = switch (self.color_scheme) {
.dark => .light,
.light => .dark,
};
self.logger.print("color scheme: {s}", .{@tagName(self.color_scheme)});
}
pub const toggle_color_scheme_meta: Meta = .{ .description = "Toggle dark/light color scheme" };
pub fn toggle_input_mode(self: *Self, _: Ctx) Result {
var it = std.mem.splitScalar(u8, self.config_.input_mode, '/');
self.config_.input_mode = it.first();