Change the code so that the editor can work in Mac

The new line character in mac and windows are "\n" now.