The postgres engine saves the function bodies, at least, without removing the carriage returns.
Could it be changed to report the LINE within the function body that has the problem, based on the carriage return?
I don't have an editor that counts characters within a document, but even if I did, Postgres doesn't consistently use that to say where the error is. It sometimes uses characters within a line,sometimes characters within the document.