https://kotlinlang.org logo
n

Nikky

06/12/2021, 8:42 AM
@louiscad i think i found what is wrong with the extra newlines on windows you insert newlines with
appendln()
but in
removeCommentsAddedByUs
you only remove
\n////
and when finding the
indexOfNewLine
you look only for
\n
, but it could be
\r\n
i think the "safest" and laziest way to do this would be to always replace all
\r\n
with
\n
another option is
System.lineSeparator()
or only inserting
\n
(but then if the file somehow does get converted to CRLF its back to the same issue i guess)