Inaccurate explanation for `activeEditor`
This section of the dev docs contains an inaccurate explanation for Workspace.activeEditor.
https://docs.obsidian.md/Plugins/Releasing/Plugin+guidelines#Avoid+accessing+%60workspace.activeLeaf%60+directly
If you want to access the editor in the active note, use activeEditor instead:
const editor = this.app.workspace.activeEditor;
The docs seems to say that activeEditor is an Editor object, but it's actually MarkdownFileInfo and in most cases, it's exactly the same MarkdownView as this.app.workspace.getActiveViewOfType(MarkdownView) (except for some corner cases like canvas).
So the sample code for activeEditor should be
const editor = this.app.workspace.activeEditor?.editor;
if (editor) {
// do something
}
@liamcain can you take care of this when you get a chance?
I've opened a PR to update this code sample!