summaryrefslogtreecommitdiff
path: root/helix-view/src/editor.rs
diff options
context:
space:
mode:
authorBlaž Hrastnik2020-10-22 05:35:07 +0000
committerBlaž Hrastnik2020-12-03 04:10:35 +0000
commitb39849dde1b1277d14dbc4e2e1604e5d020db43d (patch)
treec247d4f605db00248eaa0a4383c5ec65db5f69cc /helix-view/src/editor.rs
parent81ccca0c6a18de86223b8142b5742e0603b9b230 (diff)
Refactor: Document type as a wrapper around barebones State.
Diffstat (limited to 'helix-view/src/editor.rs')
-rw-r--r--helix-view/src/editor.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs
index 61abd482..02199255 100644
--- a/helix-view/src/editor.rs
+++ b/helix-view/src/editor.rs
@@ -1,6 +1,5 @@
use crate::theme::Theme;
-use crate::View;
-use helix_core::State;
+use crate::{Document, View};
use std::path::PathBuf;
@@ -27,8 +26,8 @@ impl Editor {
pub fn open(&mut self, path: PathBuf, size: (u16, u16)) -> Result<(), Error> {
let pos = self.views.len();
- let state = State::load(path, self.theme.scopes())?;
- self.views.push(View::new(state, size)?);
+ let doc = Document::load(path, self.theme.scopes())?;
+ self.views.push(View::new(doc, size)?);
self.focus = pos;
Ok(())
}