From c6ed937976218bf00af1776660915103bebf0317 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Mon, 17 Nov 2025 18:15:48 +0100 Subject: [PATCH] feat: add toggle_centered_view command --- src/tui/tui.zig | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/tui/tui.zig b/src/tui/tui.zig index 9129989..09a8462 100644 --- a/src/tui/tui.zig +++ b/src/tui/tui.zig @@ -1020,6 +1020,14 @@ const cmds = struct { } pub const toggle_highlight_columns_meta: Meta = .{ .description = "Toggle highlight columns" }; + pub fn toggle_centered_view(self: *Self, _: Ctx) Result { + defer self.logger.print("centered view {s}", .{if (self.config_.centered_view) "enabled" else "disabled"}); + self.config_.centered_view = !self.config_.centered_view; + try save_config(); + resize(); + } + pub const toggle_centered_view_meta: Meta = .{ .description = "Toggle centered view" }; + pub fn force_color_scheme(self: *Self, ctx: Ctx) Result { self.force_color_scheme(if (try ctx.args.match(.{"dark"})) .dark