Moved line-tracking code to the custom text editor.