setSpell sets spell correct functions so that spell correct will automatically be offered as the user types
()
| 1045 | // setSpell sets spell correct functions so that spell correct will |
| 1046 | // automatically be offered as the user types |
| 1047 | func (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 |
| 1059 | func (tb *Buffer) correctText(s string) { |
no test coverage detected