PlayGround undo (ctrl-z) after ClearCode

:disappointed_relieved: Editing my PG I accidentally hit Clear Code instead of Options
All my edited changes are gone. Undo (with Ctrl-z) is not possible.
Could you please implement any fool-prove function to avoid this?
May be a “really” dialog,
or an eye-catching “Undo” button.
or that Ctrl-z please.

Sorry for your loss @DerKarlos :frowning_face:
You can enable the “really” dialog by enabling safe mode at the options.

If someone wants to implement the ctrl-z, in monacoManager.ts you can do this to replace the code while keeping the history:

public setCode(code: string) {
    let fullRange = this._editor.getModel()!.getFullModelRange();
    this._editor.executeEdits('monacoManager', [{ range: fullRange, text: code }]);
}

Thank you @Gijs, it was not that bad.
Save Mode: Who reads the Manual anyway? I expected something like Auto-Save and did not want to spoil you server with endless versions.
The “Really?” is fine. May be it could be the default while ctrl-Z still may be usefull.