Port most of cursor movement logic

This commit is contained in:
Joscha 2022-07-20 14:07:02 +02:00
parent 4cf0d861db
commit 48943f2316
4 changed files with 94 additions and 254 deletions

View file

@ -19,23 +19,6 @@ pub enum Mode {
// Flat,
}
pub struct Cursor<I> {
id: I,
/// Where on the screen the cursor is visible (`0.0` = first line, `1.0` =
/// last line).
proportion: f32,
}
impl<I> Cursor<I> {
/// Create a new cursor with arbitrary proportion.
pub fn new(id: I) -> Self {
Self {
id,
proportion: 0.0,
}
}
}
pub struct ChatState<M: Msg, S: MsgStore<M>> {
store: S,
mode: Mode,