Changelog
v1.1.1 (2022-12-8 — Insider build)
file-open
event is now fired when focusing a Canvas file card.activeEditor
on the Workspace. When a markdown view is active, this will point to the underlying MarkdownEditView
. If a canvas view is active, this will be an EmbeddedEditor component.With these two changes, plugins should be able to adapt to the new Canvas view quite easily. Custom
views that react the the currently focused views will automatically respond to the user clicking
on file cards in the canvas. If a plugin is currently accessing the Editor
using the following
approach:
let view = app.workspace.getActiveViewOfType(MarkdownView);
if (view) {
let editor = view.editor;
// or
let file = view.file;
}
Instead you can access the editor
or file
by looking under the activeEditor
:
let { activeEditor } = app.workspace;
if (activeEditor) {
let editor = activeEditor.editor;
let file = activeEditor.file;
}