Fix scrolling when composing a new thread

When composing a new thread and writing more than one line, the chat
wouldn't scroll to make the editor cursor visible again. My original
guess for when the scrolling code should run was a bit too restrictive.
This commit is contained in:
Joscha 2022-08-03 03:06:04 +02:00
parent 4d1a42427a
commit 2dfdbbb4d2

View file

@ -327,21 +327,8 @@ impl<M: Msg + ChatMsg, S: MsgStore<M>> InnerTreeViewState<M, S> {
}
fn scroll_so_cursor_is_visible(&self, frame: &mut Frame, blocks: &mut TreeBlocks<M::Id>) {
if !matches!(
self.cursor,
Cursor::Msg(_)
| Cursor::Editor {
parent: Some(_),
..
}
| Cursor::Pseudo {
parent: Some(_),
..
}
) {
// In all other cases, there is no need to make the cursor visible
// since scrolling behaves differently enough.
return;
if matches!(self.cursor, Cursor::Bottom) {
return; // Cursor is locked to bottom
}
let block = blocks