code for text editor