diff --git a/src/buffer/View.zig b/src/buffer/View.zig index 379785fc..1d5a89be 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; } } diff --git a/src/keybind/builtin/flow.json b/src/keybind/builtin/flow.json index 0415135b..d9462d42 100644 --- a/src/keybind/builtin/flow.json +++ b/src/keybind/builtin/flow.json @@ -25,7 +25,6 @@ ["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"], @@ -603,7 +602,6 @@ ["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"] diff --git a/src/tui/mainview.zig b/src/tui/mainview.zig index 985819c6..e3463aad 100644 --- a/src/tui/mainview.zig +++ b/src/tui/mainview.zig @@ -59,7 +59,6 @@ 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, @@ -261,10 +260,6 @@ 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); } @@ -286,7 +281,6 @@ 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; @@ -945,26 +939,10 @@ const cmds = struct { else if (self.is_panel_view_showing(terminal_view)) try self.toggle_panel_view(terminal_view, .toggle) else - try focus_terminal(self, .{}); + try self.toggle_panel_view(logview, .toggle); } 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); }