Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:bug: Display spell check menu items for misspelled words https://github.com/siyuan-note/siyuan/issues/12762

Daniel03e1d6e467a2
diff --git a/app/electron/main.js b/app/electron/main.js
index 4175884fb5..9283fe0fb8 100644
--- a/app/electron/main.js
+++ b/app/electron/main.js
@@ -95,7 +95,7 @@ const isMatchingContextMenuRequest = (context, request) => {
const popupNativeTextContextMenu = (contents, context, request) => {
const params = context?.params;
const template = [];
- if (params?.spellcheckEnabled && params.misspelledWord) {
+ if (params?.misspelledWord) {
params.dictionarySuggestions.forEach((suggestion) => {
template.push(new MenuItem({
label: suggestion,
@@ -152,13 +152,12 @@ const dispatchContextMenuRequests = (contents) => {
if (spellcheckRequest && isMatchingContextMenuRequest(context, spellcheckRequest)) {
context.delivered = true;
pendingSpellcheckRequests.delete(contents.id);
- const enabled = context.params.isEditable && context.params.spellcheckEnabled;
contents.send("siyuan-spellcheck-context", {
contextId: context.contextId,
x: spellcheckRequest.x,
y: spellcheckRequest.y,
- misspelledWord: enabled ? context.params.misspelledWord : "",
- dictionarySuggestions: enabled ? context.params.dictionarySuggestions : [],
+ misspelledWord: context.params.misspelledWord,
+ dictionarySuggestions: context.params.dictionarySuggestions,
});
return;
}