Finally found answer, thanks to John Skeet who gave me a hint.
Behaviour was caused by the code editor - in our case Visual Studio 2022. Basically each code editor allows you to define line breaks behaviour and you can override it by settings in .editorconfig
- property end_of_line
- see documentation
Here is an example of the .editorConfig
file:
# To learn more about .editorconfig see https://aka.ms/editorconfigdocs
[*.cs]
end_of_line = crlf
You can also define behaviour for files in Git repository using .gitattributes
file:
*.cs text eol=crlf
Visual Studio also allows you to reformat current file using option Edit->Advanced->Set End of Line Sequence
but this is just applied to currently opened file.
