Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: removed a lot of unused imports, variables and functions, and refactored deprecated code. #158

Merged
merged 3 commits into from
Apr 16, 2024

Conversation

s4my
Copy link

@s4my s4my commented Apr 12, 2024

This commit is pretty much a cleanup of unused imports, variables and functions for perf reasons. And I also in the process refactored the editor instances to get rid of the now obsolete API Workspace.activeLeaf. If I deleted anything I shouldn't of, please do tell.

@cumany
Copy link
Collaborator

cumany commented Apr 13, 2024

It's great to see you optimizing the code again. One line like editor = app.workspace.activeLeaf.view?.editor; it using the deprecated activeLeaf is because some editors aren't of the Markdown type, such as the canvas and thino plugins. Especially with the thino plugin, recent updates have been made to ensure compatibility. I recommend downloading and try if it functions properly.

@s4my s4my force-pushed the perf/deadcode branch 2 times, most recently from 185aa9f to 1024ae8 Compare April 14, 2024 02:07
@s4my
Copy link
Author

s4my commented Apr 14, 2024

It's great to see you optimizing the code again. One line like editor = app.workspace.activeLeaf.view?.editor; it using the deprecated activeLeaf is because some editors aren't of the Markdown type, such as the canvas and thino plugins. Especially with the thino plugin, recent updates have been made to ensure compatibility. I recommend downloading and try if it functions properly.

I don't know what's the "the thino plugins", I didn't find anything on google? and in canvas, even the current version doesn't work, so I reverted those changes cause fixing that is a separate issue.

@cumany
Copy link
Collaborator

cumany commented Apr 14, 2024

plugin url:
https://obsidian.md/plugins?search=thino

@s4my
Copy link
Author

s4my commented Apr 14, 2024

plugin url: https://obsidian.md/plugins?search=thino

Like I said, you can merge this is commit as is (I reverted the changes to the deprecated version), and we leave that as a separate issue since personally the current version of the toolbar doesn't work in canvas, you should test it yourself.

@cumany cumany merged commit ce9e7ef into PKM-er:master Apr 16, 2024
@s4my s4my deleted the perf/deadcode branch April 16, 2024 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants