put caret at end when switching tabs