feat: add toggle_centered_view command

This commit is contained in:
CJ van den Berg 2025-11-17 18:15:48 +01:00
parent 65fe2bc5c2
commit c6ed937976
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -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