Fix error on init

This commit is contained in:
Andras Schmelczer 2025-11-18 20:42:10 +00:00
parent e75298c4f1
commit 813de6e31d

View file

@ -33,7 +33,7 @@ export class RemoteCursorsPluginValue implements PluginValue {
isOutdated: boolean;
}[] = [];
private static app: App;
private static app?: App;
public decorations: DecorationSet = RangeSet.of([]);
public static setCursors(
@ -88,7 +88,7 @@ export class RemoteCursorsPluginValue implements PluginValue {
private static findFileForEditor(
editor: EditorView
): RelativePath | undefined {
return RemoteCursorsPluginValue.app.workspace
return RemoteCursorsPluginValue.app?.workspace
.getLeavesOfType("markdown")
.map((leaf) => leaf.view)
.filter((view) => view instanceof MarkdownView)