diff --git a/src/ui/chat/tree/layout.rs b/src/ui/chat/tree/layout.rs index 6b3d128..4f6155f 100644 --- a/src/ui/chat/tree/layout.rs +++ b/src/ui/chat/tree/layout.rs @@ -48,7 +48,11 @@ impl> InnerTreeViewState { last_cursor_path: &Path, size: Size, ) -> i32 { - if let Some(block) = last_blocks.find(|b| cursor.matches_block(b)) { + if matches!(cursor, Cursor::Bottom) { + // Ensures that a Cursor::Bottom is always at the bottom of the + // screen. Will be scroll-clamped to the bottom later. + 0 + } else if let Some(block) = last_blocks.find(|b| cursor.matches_block(b)) { block.line } else if last_cursor_path < cursor_path { // If the cursor is bottom, the bottom marker needs to be located at