-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
https://github.com/cristianvasquez/obsidian-lab/blob/2497bff7046cbee8…
…dd1e3b436235f73696eacf53/src/main.ts#L41 I don't think making static classes are necessary, you can just declare your variables and functions right in the root of the file and use them directly. https://github.com/cristianvasquez/obsidian-lab/blob/2497bff7046cbee8dd1e3b436235f73696eacf53/src/main.ts#L135 This is a bad idea to do here - you will block the app from loading and cause the app startup time to delay. What you should do is run this asynchronously in another function, without await on the result. Actually, ideally you can do this dynamically without having to reload the plugin https://github.com/cristianvasquez/obsidian-lab/blob/2497bff7046cbee8dd1e3b436235f73696eacf53/src/main.ts#L138 It seems that you're looking for the workspace.onLayoutReady function. https://github.com/cristianvasquez/obsidian-lab/blob/2497bff7046cbee8dd1e3b436235f73696eacf53/src/main.ts#L204 This function name is kinda misleading. https://github.com/cristianvasquez/obsidian-lab/blob/2497bff7046cbee8dd1e3b436235f73696eacf53/src/main.ts#L218 Here you should use getActiveViewOfType(MarkdownView) and test for truthiness instead of assuming that activeLeaf is not null. Also, you should use view.editor instead of view.sourceMode.cmEditor as cmEditor is deprecated, unless you need specific APIs from CodeMirror 5 that's not available from Editor. Maybe you need to run npm update to get the latest definition files. https://github.com/cristianvasquez/obsidian-lab/blob/2497bff7046cbee8dd1e3b436235f73696eacf53/src/main.ts#L237 Result isn't returned. Why not just use await for these, instead of mixing async/await and .then()? https://github.com/cristianvasquez/obsidian-lab/blob/2497bff7046cbee8dd1e3b436235f73696eacf53/src/panel.ts#L29 This should just call redraw since every usage of it calls it right after. https://github.com/cristianvasquez/obsidian-lab/blob/2497bff7046cbee8dd1e3b436235f73696eacf53/src/main.ts#L325 You're probably looking for Workspace.detachLeavesOfType (or getLeavesOfType) If not, you can just use leaf.getViewType instead of leaf.getViewState().type
- Loading branch information
1 parent
3dd3f20
commit 153fcfc
Showing
5 changed files
with
20 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters