# HG changeset patch # User Ludovic Chabant # Date 1700615718 28800 # Node ID 4f6cbc0b339ce5b32c4e5a808fc023f7adc423b8 # Parent 666e93f1bd3e63768fa1c1f234f24dcf1935f040 Remove checks for legacy editor. diff -r 666e93f1bd3e -r 4f6cbc0b339c src/main.ts --- a/src/main.ts Mon Oct 02 18:13:31 2023 -0700 +++ b/src/main.ts Tue Nov 21 17:15:18 2023 -0800 @@ -152,14 +152,6 @@ this._globalUninstallers.push(uninstall); this.addSettingTab(new RememberFileStatePluginSettingTab(this.app, this)); - - if ((this.app.vault as any).getConfig('legacyEditor') !== false) { - new WarningModal( - this.app, - "Legacy Editor Not Supported", - "The 'Remember File State' plugin works only with the new editor. Please turn off 'Legacy Editor' in the options." - ).open(); - } } onunload() { @@ -364,10 +356,9 @@ // Save current selection. CodeMirror returns a JSON object (not a // JSON string!) when we call toJSON. - // If state selection is undefined, we have a legacy editor. Just ignore that part. const cm6editor = view.editor as EditorWithCM6; const stateSelection: EditorSelection = cm6editor.cm.state.selection; - const stateSelectionJSON = (stateSelection !== undefined) ? stateSelection.toJSON() : undefined; + const stateSelectionJSON = stateSelection.toJSON(); const stateData = {'scrollInfo': scrollInfo, 'selection': stateSelectionJSON};