MCPcopy
hub / github.com/lmorg/murex / Spellchecker

Function Spellchecker

shell/shell.go:370–383  ·  view source on GitHub ↗
(r []rune)

Source from the content-addressed store, hash-verified

368var ignoreSpellCheckErr atomic.Bool
369
370func 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}

Callers 1

TestSpellcheckBadBlockFunction · 0.92

Calls 3

StringFunction · 0.92
ExpandConstsFunction · 0.92
ErrorMethod · 0.65

Tested by 1

TestSpellcheckBadBlockFunction · 0.74