Undo buffer and removed trailing newline