From 05cba52397084ac2f2c53b25b8da31b51c77fd5c Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Thu, 26 Feb 2026 20:29:36 +0100 Subject: [PATCH 1/4] fix: crash in View when panel is maximized --- src/buffer/View.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/buffer/View.zig b/src/buffer/View.zig index 1d5a89be..379785fc 100644 --- a/src/buffer/View.zig +++ b/src/buffer/View.zig @@ -109,8 +109,8 @@ fn clamp_row(self: *Self, cursor: *const Cursor, abs: bool, bottom_offset: usize } if (cursor.row < self.row) { self.row = 0; - } else if (cursor.row > self.row + self.rows - bottom_min_border_distance) { - self.row = cursor.row + bottom_min_border_distance - self.rows; + } else if (cursor.row > self.row + self.rows -| bottom_min_border_distance) { + self.row = cursor.row + bottom_min_border_distance -| self.rows; } } From 871d40f906be3b8d06b101b26019771d12174ef2 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Thu, 26 Feb 2026 20:30:37 +0100 Subject: [PATCH 2/4] refactor: add toggle_panel_maximize command --- src/tui/mainview.zig | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/tui/mainview.zig b/src/tui/mainview.zig index e3463aad..19cfde38 100644 --- a/src/tui/mainview.zig +++ b/src/tui/mainview.zig @@ -59,6 +59,7 @@ buffer_manager: Buffer.Manager, find_in_files_state: enum { init, adding, done } = .done, file_list_type: FileListType = .find_in_files, panel_height: ?usize = null, +panel_maximized: bool = false, symbols: std.ArrayListUnmanaged(u8) = .empty, symbols_complete: bool = true, closing_project: bool = false, @@ -260,6 +261,10 @@ pub fn handle_resize(self: *Self, pos: Box) void { if (self.panel_height) |h| if (h >= self.box().h) { self.panel_height = null; }; + if (self.panel_maximized) { + if (self.panels) |panels| + panels.layout_ = .{ .static = self.box().h -| 1 }; + } self.widgets.handle_resize(pos); self.floating_views.resize(pos); } @@ -281,6 +286,7 @@ fn bottom_bar_primary_drag(self: *Self, y: usize) tp.result { }; const h = self.plane.dim_y(); self.panel_height = @max(1, h - @min(h, y + 1)); + self.panel_maximized = false; panels.layout_ = .{ .static = self.panel_height.? }; if (self.panel_height == 1) { self.panel_height = null; @@ -943,6 +949,22 @@ const cmds = struct { } pub const toggle_panel_meta: Meta = .{ .description = "Toggle panel" }; + pub fn toggle_maximize_panel(self: *Self, _: Ctx) Result { + const panels = self.panels orelse return; + const max_h = self.box().h -| 1; + if (self.panel_maximized) { + // Restore previous height + self.panel_maximized = false; + panels.layout_ = .{ .static = self.get_panel_height() }; + } else { + // Maximize: fill screen minus status bar + self.panel_maximized = true; + panels.layout_ = .{ .static = max_h }; + } + tui.resize(); + } + pub const toggle_maximize_panel_meta: Meta = .{ .description = "Toggle maximize panel" }; + pub fn toggle_logview(self: *Self, _: Ctx) Result { try self.toggle_panel_view(logview, .toggle); } From 770fa884cd814fad3ef8848dd519331bbe7ce102 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Thu, 26 Feb 2026 20:30:56 +0100 Subject: [PATCH 3/4] feat: add keybinds for toggle_maximize_panel --- src/keybind/builtin/flow.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/keybind/builtin/flow.json b/src/keybind/builtin/flow.json index d9462d42..0415135b 100644 --- a/src/keybind/builtin/flow.json +++ b/src/keybind/builtin/flow.json @@ -25,6 +25,7 @@ ["ctrl+8", "focus_split", 7], ["ctrl+`", "focus_terminal"], ["ctrl+j", "toggle_panel"], + ["ctrl+shift+j", "toggle_maximize_panel"], ["ctrl+q", "quit"], ["ctrl+w", "close_split"], ["ctrl+o", "open_file"], @@ -602,6 +603,7 @@ ["alt+shift+p", "open_command_palette"], ["alt+x", "open_command_palette"], ["alt+!", "run_task"], + ["ctrl+shift+j", "toggle_maximize_panel"], ["alt+f9", "panel_next_widget_style"], ["ctrl+shift+q", "quit_without_saving"], ["ctrl+alt+shift+r", "restart"] From f68102e44878721c27dc0bfc19261ae482bdac53 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Thu, 26 Feb 2026 20:31:16 +0100 Subject: [PATCH 4/4] feat: open terminal as default panel --- src/tui/mainview.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tui/mainview.zig b/src/tui/mainview.zig index 19cfde38..985819c6 100644 --- a/src/tui/mainview.zig +++ b/src/tui/mainview.zig @@ -945,7 +945,7 @@ const cmds = struct { else if (self.is_panel_view_showing(terminal_view)) try self.toggle_panel_view(terminal_view, .toggle) else - try self.toggle_panel_view(logview, .toggle); + try focus_terminal(self, .{}); } pub const toggle_panel_meta: Meta = .{ .description = "Toggle panel" };