Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Inconsistent Line Endings

Discussion in 'Scripting' started by tgraupmann, Aug 24, 2011.

  1. tgraupmann

    tgraupmann

    Joined:
    Sep 14, 2007
    Posts:
    828
    The Epic battle will never end whether to use unix, mac, or dos style line endings. Fortunately, I have this handy script that adds an Assets menu item to convert to dos line endings.

    If you have mixed line endings, the Unity console will print a warning.

    Typically you'll get mixed line endings with copy/paste or trying to use both MonoDevelop and Visual Studo.

    Check out the toolbox to enforce your line ending style. http://u3d.as/2gR
     
    Last edited: Aug 17, 2012
  2. salomonbashir

    salomonbashir

    Joined:
    Jul 11, 2012
    Posts:
    1
    If you are using Microsoft VS , go to file->advanced save options and the then choose Windows(CR-LF) ,
    i just tried this and work with my .
    btw ...I 'm using windows xp with visual studio 2008 32-bit
    i hope this help you
     
    theonlybrien, domkia and 420BlazeIt like this.
  3. itos

    itos

    Joined:
    Nov 21, 2012
    Posts:
    7
    I am using Visual Studio Express 2013 with Windows 7 x64 and I was having a lot of this problems. Hopefully your fix will work. Weird thing that with Visual Studio Express 2010 I never had this warning.
     
  4. willemsenzo

    willemsenzo

    Joined:
    Nov 15, 2012
    Posts:
    585
    This is indeed very annoying, I'm getting the message all the time even though I don't copy/paste code. It seems to happen when I'm cleaning up my code by removing empty lines with delete. Fortunately there is a fix for this mentioned by salomonbashir.
     
  5. Bladesfist

    Bladesfist

    Joined:
    Jan 3, 2012
    Posts:
    107
    The Unity script templates have Unix line endings. You can edit them so that new scripts will start with Windows line endings however it is stored in your Unity install folder and overwritten every time you update Unity.
     
  6. takito

    takito

    Joined:
    Apr 15, 2013
    Posts:
    11
    This worked perfect thanx salomon by the way im using Vs 2013 on win8
     
  7. dpolyakov

    dpolyakov

    Joined:
    Dec 18, 2015
    Posts:
    16
  8. theonlybrien

    theonlybrien

    Joined:
    Feb 9, 2015
    Posts:
    2
    Well done!
     
  9. Chizambers

    Chizambers

    Joined:
    Jan 5, 2012
    Posts:
    7
    I just tried this. Very helpful. Now I don't have to change the Advanced Save Options settings every time I made a new file in Unity.