diff --git a/cove-tui/src/chat/tree.rs b/cove-tui/src/chat/tree.rs index a2ddb36..f9e3e46 100644 --- a/cove-tui/src/chat/tree.rs +++ b/cove-tui/src/chat/tree.rs @@ -405,6 +405,12 @@ impl TreeView { } } + async fn center_cursor(&mut self, cursor: &mut Option>) { + if let Some(cursor) = cursor { + cursor.proportion = 0.5; + } + } + pub async fn handle_key_event>( &mut self, store: &mut S, @@ -416,6 +422,7 @@ impl TreeView { ) { match event.code { KeyCode::Char('k') => self.move_to_prev_msg(store, room, cursor).await, + KeyCode::Char('z') => self.center_cursor(cursor).await, _ => {} } }