Skip to content

Commit 172d32a

Browse files
committed
Fix for Obsidian 1.5
1 parent 3cb9f34 commit 172d32a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

AutoDirPlugin.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ export function getAutoDirectionPlugin(rtlPlugin: RtlPlugin) {
4747
this.rtlPlugin = rtlPlugin;
4848
this.view = view;
4949
const editorInfo = this.view.state.field(editorInfoField);
50-
if (editorInfo instanceof MarkdownView) {
50+
// Checking for editorInfo.editMode because apparently editorInfo.editor which is needed later
51+
// is a getter which counts on this field to exist
52+
if (editorInfo && editorInfo instanceof MarkdownView && (editorInfo as any).editMode) {
5153
this.rtlPlugin.adjustDirectionToView(editorInfo, this);
5254
}
5355
this.rtlPlugin.handleIframeEditor(this.view.dom, this.view, editorInfo.file, this);

0 commit comments

Comments
 (0)