feat: add spell check (#2236)

Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
Philip Molares 2022-08-04 19:57:19 +02:00 committed by GitHub
parent f68b3ff056
commit 1ff9e1f432
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 6 deletions

View file

@ -84,6 +84,7 @@ export const EditorPane: React.FC<ScrollProps> = ({ scrollState, onScroll, onMak
const yjsExtension = useCodeMirrorYjsExtension(yText, awareness)
const [firstEditorUpdateExtension, firstUpdateHappened] = useOnFirstEditorUpdateExtension()
useInsertNoteContentIntoYTextInMockModeEffect(firstUpdateHappened, websocketConnection)
const spellCheck = useApplicationState((state) => state.editorConfig.spellCheck)
// ToDo: Don't initialize new extension array here, instead refactor to global extension array
const markdownExtensionsLinters = useMemo(() => {
@ -114,7 +115,8 @@ export const EditorPane: React.FC<ScrollProps> = ({ scrollState, onScroll, onMak
cursorActivityExtension,
updateViewContext,
yjsExtension,
firstEditorUpdateExtension
firstEditorUpdateExtension,
EditorView.contentAttributes.of({ spellcheck: String(spellCheck) })
],
[
linter,
@ -124,7 +126,8 @@ export const EditorPane: React.FC<ScrollProps> = ({ scrollState, onScroll, onMak
cursorActivityExtension,
updateViewContext,
yjsExtension,
firstEditorUpdateExtension
firstEditorUpdateExtension,
spellCheck
]
)