Fixed bug where input method would produce new lines when inserting contents to an empty editor.