Skip to content

Commit

Permalink
Don't grow multiline setting values on every save
Browse files Browse the repository at this point in the history
  • Loading branch information
romainguy committed Sep 5, 2024
1 parent 986f91b commit a70f1f2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/jvmMain/kotlin/dev/romainguy/kotlin/explorer/State.kt
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,10 @@ private fun readSettings(file: Path): MutableMap<String, String> {
do {
i++
if (i >= lines.size) break
value += lines[i].dropLast(1) + '\n'
} while (lines[i].endsWith('\\'))
value += lines[i].dropLast(1)
val continuation = lines[i].endsWith('\\')
if (continuation) value += '\n'
} while (continuation)
}
settings[line.substring(0, index)] = value
}
Expand Down

0 comments on commit a70f1f2

Please # to comment.