Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'helix-core/src/state.rs')
-rw-r--r--helix-core/src/state.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/helix-core/src/state.rs b/helix-core/src/state.rs
new file mode 100644
index 00000000..dcc4b11b
--- /dev/null
+++ b/helix-core/src/state.rs
@@ -0,0 +1,17 @@
+use crate::{Rope, Selection};
+
+#[derive(Debug, Clone)]
+pub struct State {
+ pub doc: Rope,
+ pub selection: Selection,
+}
+
+impl State {
+ #[must_use]
+ pub fn new(doc: Rope) -> Self {
+ Self {
+ doc,
+ selection: Selection::point(0),
+ }
+ }
+}