Fix text editor behaviour