initSpell ensures that the [spell.Spell] spell checker is set up.
()
| 21 | |
| 22 | // initSpell ensures that the [spell.Spell] spell checker is set up. |
| 23 | func initSpell() error { |
| 24 | if core.TheApp.Platform().IsMobile() { // todo: too slow -- fix with aspell |
| 25 | return nil |
| 26 | } |
| 27 | if spell.Spell != nil { |
| 28 | return nil |
| 29 | } |
| 30 | pdir := core.TheApp.CogentCoreDataDir() |
| 31 | openpath := filepath.Join(pdir, "user_dict_en_us") |
| 32 | spell.Spell = spell.NewSpell(openpath) |
| 33 | return nil |
| 34 | } |
| 35 | |
| 36 | // spellCheck has all the texteditor spell check state |
| 37 | type spellCheck struct { |