1
0
Fork 0
mirror of https://github.com/helix-editor/helix synced 2024-06-01 07:46:05 +02:00

Bump document version on undo/redo.

This commit is contained in:
Blaž Hrastnik 2020-10-23 11:37:32 +09:00
parent efc5aa2016
commit e4070d4de0

View File

@ -504,6 +504,7 @@ pub fn insert_char_prompt(prompt: &mut Prompt, c: char) {
pub fn undo(view: &mut View, _count: usize) {
if let Some(revert) = view.doc.history.undo() {
view.doc.version += 1;
view.doc.apply(&revert);
}
@ -512,6 +513,7 @@ pub fn undo(view: &mut View, _count: usize) {
pub fn redo(view: &mut View, _count: usize) {
if let Some(transaction) = view.doc.history.redo() {
view.doc.version += 1;
view.doc.apply(&transaction);
}
}