aboutsummaryrefslogtreecommitdiff
path: root/helix-view/src/document.rs
diff options
context:
space:
mode:
authorBlaž Hrastnik2020-10-23 02:36:46 +0000
committerBlaž Hrastnik2020-12-03 04:10:35 +0000
commitefc5aa2016e56e0721d125a20e3573d25af4dd76 (patch)
tree7db8aa4c14c5d2873fb0acd4bba54a36eef9f410 /helix-view/src/document.rs
parentc0e17dd324f016401d56d66b7c113dada0644155 (diff)
Simplify old_state handling.
Diffstat (limited to 'helix-view/src/document.rs')
-rw-r--r--helix-view/src/document.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/helix-view/src/document.rs b/helix-view/src/document.rs
index 04018ed6..22438926 100644
--- a/helix-view/src/document.rs
+++ b/helix-view/src/document.rs
@@ -27,9 +27,9 @@ pub struct Document {
/// Pending changes since last history commit.
pub changes: ChangeSet,
+ pub old_state: State,
pub history: History,
pub version: i64, // should be usize?
- pub old_state: Option<(Rope, Selection)>,
pub diagnostics: Vec<Diagnostic>,
}
@@ -55,7 +55,7 @@ use url::Url;
impl Document {
fn new(state: State) -> Self {
let changes = ChangeSet::new(&state.doc);
- let old_state = Some((state.doc.clone(), Selection::single(0, 0)));
+ let old_state = state.clone();
Self {
path: None,