Newline character in windows


#1

Hi,

I use Atom in windows, but when I save the document, it saves with Unix style line endings ("\n") instead of Windows style ("\r\n"), so the saved document cannot be displayed properly in other windows editors
I cannot find any place discussing about this or any setting to change line endings character
Is there anyway to fix this?

Thanks


Anyone else experiencing weird line endings like this?
#2

The configuration guide explains how to do this if you look for “invisibles” on the page.


#3

The invisibles setting just controls how CR and LF characters are displayed in Atom if they exist in the file (when the “Show Invisibles” setting is enabled). It doesn’t control whether or not they are inserted into the file on pressing RETURN.

Atom attempts to auto-detect what line ending a file uses and continues to use that. There is currently not a feature to override this nor is there an ability to specify the default as something other than the LF character. There is a feature request that can be subscribed to here:


#4

Thanks. I really like Atom, but this is the main thing that currently holding me back from using it as main editor since I do all of my work in Windows. It would be great if Atom can integrate this feature soon


#5

Searching the web for that exact issue with Atom I found this discussion. I agree with @hpcsc because as Windows user I would appreciate very much, to choose an appropriate newline character for my work. Otherwise I still need to use another editor, but I would like to be able to do ALL THE WORK with Atom only.

EDIT: In the meantime I have to admit, the package line-ending-converter is an adequate workaround. Anyway there is still the current line ending character in the status bar missing.


#6

I must agree with everyone here. I have been trying out Atom which is great, but not having the ability to easily change line endings and set a default line ending has sent me back to me beloved Sublime Text :smile:


#7

Same here. Atom effectively doesn’t changes the line endings in our existing codebase, however it always defaults to LF when I create new files. If it cannot be configured in some kind of project config, it should be the system’s default, or at least an option.


#8

You can configure the default line ending with the line-ending-converter package.