From 3f0578a9095c312ff7af04f10c4648b1560caff2 Mon Sep 17 00:00:00 2001 From: Ingo Lohmar Date: Sat, 21 Feb 2026 15:19:04 +0100 Subject: [PATCH 1/2] fix: scroll_view_center_cycle no-op in "dead" area, fix bottom scroll offset Testing for precise rows leads to a "dead" area if cursor row is in topmost half-screen of a file. Less strict comparison makes the command useful in that area as well. --- src/tui/editor.zig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tui/editor.zig b/src/tui/editor.zig index a0ac0c47..1f28336d 100644 --- a/src/tui/editor.zig +++ b/src/tui/editor.zig @@ -3057,9 +3057,9 @@ pub const Editor = struct { pub fn scroll_view_center_cycle(self: *Self, _: Context) Result { const scroll_cursor_min_border_distance = Buffer.View.scroll_cursor_min_border_distance; const cursor_row = self.get_primary().cursor.row; - return if (cursor_row == self.view.row + scroll_cursor_min_border_distance) + return if (cursor_row <= self.view.row + scroll_cursor_min_border_distance) self.scroll_view_bottom(.{}) - else if (cursor_row == self.view.row + self.view.rows / 2) + else if (cursor_row <= self.view.row + self.view.rows / 2) self.scroll_view_top(.{}) else self.scroll_view_offset(self.view.rows / 2); @@ -3074,7 +3074,7 @@ pub const Editor = struct { pub fn scroll_view_bottom(self: *Self, _: Context) Result { const scroll_cursor_min_border_distance = Buffer.View.scroll_cursor_min_border_distance; - return self.scroll_view_offset(if (self.view.rows > scroll_cursor_min_border_distance) self.view.rows -| scroll_cursor_min_border_distance + 1 else 0); + return self.scroll_view_offset(self.view.rows -| (scroll_cursor_min_border_distance + 1)); } pub const scroll_view_bottom_meta: Meta = .{}; From a93b905bdd777a448fa6ac528b39e591ca1044b7 Mon Sep 17 00:00:00 2001 From: xoxorwr Date: Sat, 21 Feb 2026 17:02:28 +0100 Subject: [PATCH 2/2] Add auto_open_panel_for_diagnostics --- src/config.zig | 1 + src/tui/mainview.zig | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/config.zig b/src/config.zig index 8cc7cd60..194a60d7 100644 --- a/src/config.zig +++ b/src/config.zig @@ -59,6 +59,7 @@ show_bottom_bar_grip: bool = true, show_scrollbars: bool = true, show_fileicons: bool = true, show_local_diagnostics_in_panel: bool = false, +auto_open_panel_for_diagnostics: bool = true, scrollbar_auto_hide: bool = true, scroll_step_vertical: usize = 3, scroll_step_horizontal: usize = 5, diff --git a/src/tui/mainview.zig b/src/tui/mainview.zig index 6a8636da..58fb5627 100644 --- a/src/tui/mainview.zig +++ b/src/tui/mainview.zig @@ -1089,6 +1089,9 @@ const cmds = struct { if (!tui.config().show_local_diagnostics_in_panel) return; } + if (!self.is_panel_view_showing(filelist_view) and !tui.config().auto_open_panel_for_diagnostics) { + return; + } try self.add_find_in_files_result( .diagnostics, file_path,