Skip to content

Commit

Permalink
fix(Studio): Not saving file on undo / redo
Browse files Browse the repository at this point in the history
  • Loading branch information
psyGamer committed Oct 16, 2024
1 parent 27be37f commit c7708d1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Studio/CelesteStudio/Editing/Document.cs
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,12 @@ public void Undo() {

CurrentAnchors = diff.Anchors;
Caret = diff.Caret;

if (Settings.Instance.AutoSave) {
Save();
} else {
Dirty = true;
}
}
public void Redo() {
if (undoStack.Redo() is not { } diff) {
Expand All @@ -681,6 +687,12 @@ public void Redo() {

CurrentAnchors = diff.Anchors;
Caret = diff.Caret;

if (Settings.Instance.AutoSave) {
Save();
} else {
Dirty = true;
}
}

public void Insert(string text) => Caret = Insert(Caret, text);
Expand Down

0 comments on commit c7708d1

Please sign in to comment.