minor fixes

This commit is contained in:
2023-08-02 18:11:49 +02:00
parent 3e3dd368c1
commit 162cc2fae3
3 changed files with 30 additions and 36 deletions

View File

@ -127,8 +127,6 @@ export class Editor {
// CodeMirror Management
// ================================================================================
console.log(this.settings)
this.fontSize = new Compartment();
this.vimModeCompartment = new Compartment();
const vimPlugin = this.settings.vimMode ? vim() : [];
@ -679,11 +677,12 @@ document.addEventListener("keydown", startOnEnter);
document.getElementById("start-button")!.addEventListener("click", startClock);
// When the user leaves the page, all the universes should be saved in the localStorage
// window.addEventListener("beforeunload", () => {
// event.preventDefault();
// event.returnValue = "";
// // Iterate over all local files and set the candidate to the committed
// app.currentFile.candidate = app.view.state.doc.toString();
// app.currentFile.committed = app.view.state.doc.toString();
// app.settings.saveApplicationToLocalStorage(app.universes, app.settings);
// });
window.addEventListener("beforeunload", () => {
event.preventDefault();
event.returnValue = "";
// Iterate over all local files and set the candidate to the committed
app.currentFile.candidate = app.view.state.doc.toString();
app.currentFile.committed = app.view.state.doc.toString();
app.settings.saveApplicationToLocalStorage(app.universes, app.settings);
app.clock.stop()
});