- if (!available())
- return;
-
- LyXText * text = getLyXText();
-
- text->replaceSelectionWithString(replacestring);
- text->setSelectionRange(replacestring.length());
-
- // Go back so that replacement string is also spellchecked
- for (string::size_type i = 0; i < replacestring.length() + 1; ++i)
- text->cursorLeft(this);
-
- // FIXME: should be done through LFUN
- buffer()->markDirty();
- update();