Skip to content

Commit

Permalink
Update SimpleDiffUtil.kt
Browse files Browse the repository at this point in the history
  • Loading branch information
acharneski committed Mar 26, 2024
1 parent 89e3f5a commit e4c338e
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,9 @@ fun SocketManagerBase.addApplyDiffLinks2(
val diffVal = diffBlock.groupValues[2]
val prevCode = code[filename] ?: ""
val newCode = SimpleDiffUtil.patch(prevCode, diffVal)
val echoDiff = DiffMatchPatch.patch_toText(DiffMatchPatch.Companion.patch_make(prevCode, newCode))
val echoDiff = try {
DiffMatchPatch.patch_toText(DiffMatchPatch.patch_make(prevCode, newCode))
} catch (e: Throwable) { renderMarkdown("```\n${e.stackTraceToString()}\n```") }
val hrefLink = hrefLink("Apply Diff") {
try {
val newCode = code.map { (file, prevCode) ->
Expand Down

0 comments on commit e4c338e

Please sign in to comment.