@@ -27,9 +27,9 @@ pub struct Document {
28 /// Pending changes since last history commit.
28 /// Pending changes since last history commit.
29 pub changes: ChangeSet,
29 pub changes: ChangeSet,
30+ pub old_state: State,
30 pub history: History,
31 pub history: History,
31 pub version: i64, // should be usize?
32 pub version: i64, // should be usize?
32− pub old_state: Option<(Rope, Selection)>,
34 pub diagnostics: Vec<Diagnostic>,
34 pub diagnostics: Vec<Diagnostic>,
@@ -55,7 +55,7 @@ use url::Url;
55impl Document {
55impl Document {
56 fn new(state: State) -> Self {
56 fn new(state: State) -> Self {
57 let changes = ChangeSet::new(&state.doc);
57 let changes = ChangeSet::new(&state.doc);
58− let old_state = Some((state.doc.clone(), Selection::single(0, 0)));
58+ let old_state = state.clone();
61 path: None,
61 path: None,