correctText edits the text using the string chosen from the correction menu
(s string)
| 1057 | |
| 1058 | // correctText edits the text using the string chosen from the correction menu |
| 1059 | func (tb *Buffer) correctText(s string) { |
| 1060 | st := lexer.Pos{tb.spell.srcLn, tb.spell.srcCh} // start of word |
| 1061 | tb.RemoveTag(st, token.TextSpellErr) |
| 1062 | oend := st |
| 1063 | oend.Ch += len(tb.spell.word) |
| 1064 | tb.ReplaceText(st, oend, st, s, EditSignal, ReplaceNoMatchCase) |
| 1065 | if tb.currentEditor != nil { |
| 1066 | ep := st |
| 1067 | ep.Ch += len(s) |
| 1068 | tb.currentEditor.SetCursorShow(ep) |
| 1069 | tb.currentEditor = nil |
| 1070 | } |
| 1071 | } |
| 1072 | |
| 1073 | // SpellCheckLineErrors runs spell check on given line, and returns Lex tags |
| 1074 | // with token.TextSpellErr for any misspelled words |
no test coverage detected