on master help sign in
Bump document version on undo/redo.
commite4070d4de0883c3fc979b3d57b1b43ecb0a0d72f authorBlaž Hrastnik <blaz@mxxn.io> dateFri 23 Oct 2020, 11:37 (6 years ago) parentefc5aa2
1 file changed+2
helix-view/src/commands.rs+2
helix-view/src/commands.rs+2
@@ -504,6 +504,7 @@ pub fn insert_char_prompt(prompt: &mut Prompt, c: char) {
504504
505505pub fn undo(view: &mut View, _count: usize) {
506506 if let Some(revert) = view.doc.history.undo() {
507+ view.doc.version += 1;
507508 view.doc.apply(&revert);
508509 }
509510
@@ -512,6 +513,7 @@ pub fn undo(view: &mut View, _count: usize) {
512513
513514pub fn redo(view: &mut View, _count: usize) {
514515 if let Some(transaction) = view.doc.history.redo() {
516+ view.doc.version += 1;
515517 view.doc.apply(&transaction);
516518 }
517519}