on master help sign in
Bump document version on undo/redo.
e4070d4Blaž Hrastnik
helix-view/src/commands.rs+2
@@ -504,6 +504,7 @@ pub fn insert_char_prompt(prompt: &mut Prompt, c: char) {
504
504
505pub fn undo(view: &mut View, _count: usize) {
505pub fn undo(view: &mut View, _count: usize) {
506 if let Some(revert) = view.doc.history.undo() {
506 if let Some(revert) = view.doc.history.undo() {
507+ view.doc.version += 1;
507 view.doc.apply(&revert);
508 view.doc.apply(&revert);
508 }
509 }
509
510
@@ -512,6 +513,7 @@ pub fn undo(view: &mut View, _count: usize) {
512
513
513pub fn redo(view: &mut View, _count: usize) {
514pub fn redo(view: &mut View, _count: usize) {
514 if let Some(transaction) = view.doc.history.redo() {
515 if let Some(transaction) = view.doc.history.redo() {
516+ view.doc.version += 1;
515 view.doc.apply(&transaction);
517 view.doc.apply(&transaction);
516 }
518 }
517}
519}