Created
August 18, 2017 20:05
-
-
Save develar/db9ef805bbde3994ad33d010e8a40025 to your computer and use it in GitHub Desktop.
isDoNotWriteIfOnlyLineSeparatorChanged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (processor is LazySchemeProcessor && processor.isDoNotWriteIfOnlyLineSeparatorChanged && file.exists()) { | |
val detectedLineSeparator = file.detectedLineSeparator | |
// scheme always uses LF | |
if (detectedLineSeparator != LineSeparator.LF.separatorString) { | |
val oldData = file.contentsToByteArray() | |
if (detectLineSeparators(Charsets.UTF_8.decode(ByteBuffer.wrap(oldData))) != LineSeparator.LF) { | |
} | |
} | |
} | |
// easy migration if not possible to implement getSchemeState fully correctly | |
open val isDoNotWriteIfOnlyLineSeparatorChanged: Boolean | |
get() = false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment