attempt to improve TAB handling for texteditor