Menu

Detect line endings when opening

coder0xff
2015-03-04
2015-03-11
  • coder0xff

    coder0xff - 2015-03-04

    All my files have unix line endings (I'm using a network file system) but when I open them the EOL mode defaults to Windows. Any edits I make are inconsistent with the rest of the file. Even worse, if the file changes externally and I tell it to reload the file, it switches back to Windows EOL mode again. Is there a way to get Notepad++ to detect line endings when opening a file?

     
  • Justin Dailey

    Justin Dailey - 2015-03-04

    It does detect line endings. I edit both Windows and Unix EOL modes on a regular basis and have never had an issue. Maybe its because its on a network file system. Maybe try creating a file with Unix EOL on your actual hard drive and see if N++ detects line endings correctly then?

     

    Last edit: Justin Dailey 2015-03-04
  • coder0xff

    coder0xff - 2015-03-04

    You're right. Making a local copy of a file, it opens as Unix EOL. I wonder what's going on that makes it not work right over the mapped file system. In the end, it opens it with the line endings preserved so its not like its misreading the file. It's just in the wrong mode. I wonder if maybe there is some bug in Notepad++ that makes the check fail in this case. It does take a couple seconds to open a file.

     

    Last edit: coder0xff 2015-03-04
  • Gleb Stsenov

    Gleb Stsenov - 2015-03-11

    files you've got EOL changed - are they coming in through some old plain download, or there is some git-like thingie? If you open file with regular windows notepad before N++ - does it have unix EOLs (one large row) or windows?
    I had similar effect not because of N++, but because git is by default converting EOLs to current platform EOLs. When working with cygwin, it sucks. Had to set 'checkout-as-is'.