2021-03-18 14:07:02 +08:00
|
|
|
use crate::{Rope, Selection};
|
2020-09-07 10:28:52 +08:00
|
|
|
|
2021-06-07 22:34:19 +08:00
|
|
|
#[derive(Debug, Clone)]
|
2020-05-25 12:02:21 +08:00
|
|
|
pub struct State {
|
2020-09-19 22:16:00 +08:00
|
|
|
pub doc: Rope,
|
|
|
|
pub selection: Selection,
|
2020-05-25 12:02:21 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
impl State {
|
2020-05-28 13:45:44 +08:00
|
|
|
#[must_use]
|
2020-09-07 10:28:52 +08:00
|
|
|
pub fn new(doc: Rope) -> Self {
|
2020-05-25 12:02:21 +08:00
|
|
|
Self {
|
2020-06-01 16:42:28 +08:00
|
|
|
doc,
|
2021-03-14 09:04:03 +08:00
|
|
|
selection: Selection::point(0),
|
2020-05-25 12:02:21 +08:00
|
|
|
}
|
|
|
|
}
|
2020-06-05 13:02:10 +08:00
|
|
|
}
|