[TextEditor] Check offset in GetCharAt method.
Fixed 'Bug 12900 - Event handler statement completion throws an
exception'.