Open froggyfunkin opened 3 days ago
following Obsidian plugin settings is likely a stretch too far. I will add an option to allow you to disable spellcheck for the Excalidraw plugin. Not more.
Thank youu! π
Here's a DYI you can apply today. Let me know how it works.
https://github.com/user-attachments/assets/1148fee6-454c-4962-bee9-9ee6670376fd
the script you need:
if(window.electron) {
const alignElectronSpellcheckWithObsidianSettings = () => {
const session = window.electron.remote.getCurrentWebContents().session;
session.setSpellCheckerEnabled(app.vault.config.spellcheck);
if(app.vault.config.spellcheck) {
session.setSpellCheckerLanguages(navigator.languages);
}
};
const body = document.body;
const observer = new MutationObserver((mutationsList, observer) => {
for (let mutation of mutationsList) {
if (mutation.type === 'childList') {
mutation.removedNodes.forEach(node => {
if (node.classList && node.classList.contains('modal-container')) {
alignElectronSpellcheckWithObsidianSettings();
}
});
}
}
});
const config = { childList: true };
observer.observe(body, config);
alignElectronSpellcheckWithObsidianSettings();
}
Hiya sorry for the late reply, it works! π And the Obsidian native toggle spellcheck hotkey also works too on it, this is the ideal solution haha, thank you so much!
I'm not familiar with Electron in Obsidian, or coding/programming in general unfortunately, so don't know how to help/contribute with the limitations yet, apology π. Here's a little info I found on internet/Obsidian forum that might be related/useful if at all(?): https://forum.obsidian.md/t/dutch-language-support/30955/13
But on mine, for the default English language it works perfectly, including the hotkey working! Thank you again.
Is your feature request related to a problem? Please describe.
Problem: Excalidraw plugin in Obsidian currently doesn't follow Obsidian's spellcheck settings. Instead, turned on by default with no way of turning it off. This makes typos, intentional made-up-on-the-spot words/phrases, code lines/syntaxes, etc, get frustratingly repeatedly red-underlined mid-typing and editing, very visually disrupting the freeflow of thoughts and ideas when in chaotic/flow-like thought-capturing/pouring mode. Against the very essence of intuitive "write drunk, edit sober" approach for extension-of-self tools like Excalidraw and Obsidian, which is (imo) the best way to use those tools too.
Other user having the same problem when making a UML diagram:
Describe the solution you'd like
Proposed solutions:
Ideal: Make Excalidraw plugin follow native Obsidian spellcheck setting. This way the spellchecking in Excalidraw will behave/toggled the way user already set in Obsidian, and the Obsidian native toggle spellcheck hotkey would also work when used in Excalidraw plugin too when in the whiteboard screen, making the workflow even smoother and uninterrupted.
Alternatives:
Real-life usage scenarios
Real-life usage scenario example:
Describe alternatives you've considered
No response
Additional context
Additional contexts, infos, etc
Things i've tried but didn't work to disable the spellcheck of Excalidraw in Obsidian:
My current workaround for it:
Additional observations that might be related: Observation
Hypothesis
Thank you in advance That's probably about all, sorry it's long and quite messy, my first time making a github account then opening an issue, tried to follow the requirements. Also, again thank you so much for creating this plugin in the first place and even continuously maintaining and updating it, am probably already the thousandth or millionth user relying on it everyday saying that lmao, seriously wouldn't be able to have developed a deeper understanding of myself, visually thinking, world-modelling/system-making, etc this far or fast if not for Excalidraw and Obsidian, and this plugin is in the smack-dab middle of it enabling that on steroid.