question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Inconsistent Line endings

See original GitHub issue

The current code generator is using the following to transform generated code to Unix Line Endings:

str.Replace(Environment.NewLine, "\n");

However, on Win systems that have been configured to use Unix style line endings there still seems to be a handful of CRLF codes in the generated files and the above method does not catch them. A better solution would be to simply match against the actual unwanted characters:

str.Replace("\r\n", "\n").Replace("\r", "\n");

This removes any dependency on having the correct system configuration to function as intended. Note: Order or operations matters with the above code.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:3
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
sschmidcommented, Dec 15, 2016

Awesome, will be in the next release bb83d990c59266d6605da94a95389195a892a4ec

1reaction
AllanSamuraicommented, Dec 15, 2016

Tested on my own project and on Entitas-Shmup project too it fixes 😄 Thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

What does Visual Studio mean by normalize inconsistent ...
Normalizing inconsistent line endings in Visual Studio means selecting one character type to be used for all your files. It could be:.
Read more >
Normalizing line endings in Visual Studio 2019
When I open a cs file with inconsistent line endings, Visual Studio 2019 doesn't pop up Inconsistent Line Endings dialog box anymore.
Read more >
Unity: "inconsistent line endings" dialog shows up ever ...
Visual Studio will open the script with the missing and a line ending dialogue window will show up. Go to the Line endings...
Read more >
Fix inconsistent line endings - Microsoft Q&A
Hello all. To mimic this behavior: BUG IMP. A friend on this forum suggested to: Replace all vbCrLf to vbCr. Replace all vbLf...
Read more >
There are inconsistent line endings in the "Assets/Scripts ...
There are inconsistent line endings in the 'Assets/Scripts/BlahBlah.cs' script. Some are Mac OS X (UNIX) and some are Windows.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found