Mercurial > obsidian-remember-file-state
changeset 58:4f6cbc0b339c
Remove checks for legacy editor.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Tue, 21 Nov 2023 17:15:18 -0800 |
parents | 666e93f1bd3e |
children | 1d6fe880946f |
files | src/main.ts |
diffstat | 1 files changed, 1 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- 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};