aboutsummaryrefslogtreecommitdiff
path: root/helix-view/src/document.rs
diff options
context:
space:
mode:
authorBlaž Hrastnik2021-03-23 08:47:40 +0000
committerBlaž Hrastnik2021-03-23 09:14:35 +0000
commit8328fe926d34d12031cb50db47a9dd39ed681a84 (patch)
treeacea128c5a3c2276f7ad553666a6572a5ba7d62d /helix-view/src/document.rs
parent3f9a94fd4364fe277f11668b0bfab4f2735c4daf (diff)
Drop refcell use, make view simply ref doc.id.
Diffstat (limited to 'helix-view/src/document.rs')
-rw-r--r--helix-view/src/document.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/helix-view/src/document.rs b/helix-view/src/document.rs
index f6c7c70d..0286b2b9 100644
--- a/helix-view/src/document.rs
+++ b/helix-view/src/document.rs
@@ -8,6 +8,8 @@ use helix_core::{
ChangeSet, Diagnostic, History, Rope, Selection, State, Syntax, Transaction,
};
+use crate::DocumentId;
+
#[derive(Copy, Clone, PartialEq, Eq, Hash)]
pub enum Mode {
Normal,
@@ -18,6 +20,7 @@ pub enum Mode {
pub struct Document {
// rope + selection
+ pub(crate) id: DocumentId,
state: State,
path: Option<PathBuf>,
@@ -66,6 +69,7 @@ impl Document {
let old_state = None;
Self {
+ id: DocumentId::default(),
path: None,
state: State::new(text),
mode: Mode::Normal,