Maybe `guessLineEnding`?

How about we just take the first newline in the document and take the ending from it? There is no good solution for the case when you have mixed styles of newlines.