Adjust input handling in text editor