File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -724,8 +724,7 @@ export default class Editor {
724724 placeholder : "← Start by entering a title here\n===\nVisit /features if you don't know what to do.\nHappy hacking :)"
725725 } )
726726
727- // eslint-disable-next-line
728- new CodeMirrorSpellChecker ( CodeMirror )
727+ this . spellchecker = new CodeMirrorSpellChecker ( CodeMirror )
729728 this . tableEditor = initTableEditor ( this . editor )
730729
731730 return this . editor
Original file line number Diff line number Diff line change @@ -77,13 +77,17 @@ class CodeMirrorSpellChecker {
7777 }
7878
7979 this . typo = undefined
80- this . setupCM ( cm , lang )
80+ this . defineSpellCheckerMode ( cm , lang )
8181 }
8282
83- setupCM ( cm , lang ) {
83+ setDictLang ( lang ) {
84+ findOrCreateTypoInstance ( lang ) . then ( typo => { this . typo = typo } )
85+ }
86+
87+ defineSpellCheckerMode ( cm , lang ) {
8488 cm . defineMode ( 'spell-checker' , config => {
8589 // Load AFF/DIC data async
86- findOrCreateTypoInstance ( lang ) . then ( typo => { this . typo = typo } )
90+ this . setDictLang ( lang )
8791
8892 // Define what separates a word
8993 const regexWord = '!"#$%&()*+,-./:;<=>?@[\\]^_`{|}~ '
You can’t perform that action at this time.
0 commit comments