mirror of
https://github.com/ilyakooo0/helix.git
synced 2024-11-10 14:46:04 +03:00
Bump document version on undo/redo.
This commit is contained in:
parent
efc5aa2016
commit
e4070d4de0
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user