| 368 | var ignoreSpellCheckErr atomic.Bool |
| 369 | |
| 370 | func Spellchecker(r []rune) []rune { |
| 371 | s := string(r) |
| 372 | new, err := spellcheck.String(s) |
| 373 | if err != nil && !ignoreSpellCheckErr.Load() { |
| 374 | ignoreSpellCheckErr.Store(true) |
| 375 | hint := fmt.Sprintf("{RED}Spellchecker error: %s{RESET} {BLUE}https://murex.rocks/user-guide/spellcheck.html{RESET}", err.Error()) |
| 376 | Prompt.ForceHintTextUpdate(ansi.ExpandConsts(hint)) |
| 377 | return r |
| 378 | } |
| 379 | |
| 380 | ignoreSpellCheckErr.Store(false) // reset ignore status |
| 381 | |
| 382 | return []rune(new) |
| 383 | } |