diff options
author | Blaž Hrastnik | 2020-10-21 04:47:20 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2020-12-03 04:10:34 +0000 |
commit | ef5e5f9296d27d11ddfddf6d1c7daf93f9464ddb (patch) | |
tree | 9a9189b1f19a895e24b39dd9718baa8320979bc8 /helix-view/src/commands.rs | |
parent | 49254d7180c8b92be5426cab20914b0343c9282c (diff) |
state.version tracking
Diffstat (limited to 'helix-view/src/commands.rs')
-rw-r--r-- | helix-view/src/commands.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/helix-view/src/commands.rs b/helix-view/src/commands.rs index 1d7737f0..e29d070e 100644 --- a/helix-view/src/commands.rs +++ b/helix-view/src/commands.rs @@ -391,6 +391,12 @@ fn append_changes_to_history(view: &mut View) { // annotations either add a new layer or compose into the previous one. let transaction = Transaction::from(changes).with_selection(view.state.selection().clone()); + // increment document version + // TODO: needs to happen on undo/redo too + view.state.version += 1; + + // TODO: trigger lsp/documentDidChange with changes + // HAXX: we need to reconstruct the state as it was before the changes.. let (doc, selection) = view.state.old_state.take().unwrap(); let mut old_state = State::new(doc); @@ -399,7 +405,6 @@ fn append_changes_to_history(view: &mut View) { // TODO: take transaction by value? view.history.commit_revision(&transaction, &old_state); - // TODO: need to start the state with these vals // HAXX view.state.old_state = Some((view.state.doc().clone(), view.state.selection.clone())); } |