Writing a text editor following a great tutorial