4

Is it possible to keep original end of lines in the file? (I use visual studio code to edit files on a linux server through SAMBA)

There is a button at right bottom to choose either LF or CRLF, but it replace all the end of lines in the file.

example:

 line1 \r\n
 line2 \r\n
 line3 \n
Scott McPeak
  • 8,803
  • 2
  • 40
  • 79
cho
  • 41
  • 2

1 Answers1

0

No, it is not possible in VSCode to preserve the original line endings when they are not the same throughout a file. Internally, for each file, VSCode only stores a single _eol value, and when multi-line text is requested, inserts it between every line on the fly.

See, for example, method getText() in mirrorTextModel.ts. MirrorTextModel is a base class of ExtHostDocumentData, which implements the TextDocument entity exposed in the API.

Scott McPeak
  • 8,803
  • 2
  • 40
  • 79