fixed selection crash in texteditor