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