MCPcopy Create free account
hub / github.com/cogentcore/core / setSpell

Method setSpell

texteditor/buffer.go:1047–1056  ·  view source on GitHub ↗

setSpell sets spell correct functions so that spell correct will automatically be offered as the user types

()

Source from the content-addressed store, hash-verified

1045// setSpell sets spell correct functions so that spell correct will
1046// automatically be offered as the user types
1047func (tb *Buffer) setSpell() {
1048 if tb.spell != nil {
1049 return
1050 }
1051 initSpell()
1052 tb.spell = newSpell()
1053 tb.spell.onSelect(func(e events.Event) {
1054 tb.correctText(tb.spell.correction)
1055 })
1056}
1057
1058// correctText edits the text using the string chosen from the correction menu
1059func (tb *Buffer) correctText(s string) {

Callers 1

ConfigKnownMethod · 0.95

Calls 4

correctTextMethod · 0.95
initSpellFunction · 0.85
newSpellFunction · 0.85
onSelectMethod · 0.80

Tested by

no test coverage detected