File tree Expand file tree Collapse file tree
Tool/Sources/SharedUIComponents Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -282,14 +282,12 @@ extension AsyncCodeBlock {
282282 if lastLineIndex >= 0 {
283283 if let line = diffResult. line ( at: lastLineIndex, in: \. oldSnippet) ,
284284 case let . mutated( changes) = line. diff,
285- !changes. isEmpty
285+ changes. count == 1 ,
286+ let change = changes. last,
287+ change. offset + change. element. count == line. text. count
286288 {
287289 let lastLine = highlightedCode [ lastLineIndex]
288- let removedSuffix = line. text. suffix ( max (
289- 0 ,
290- line. text. count - lastLine. string. count
291- ) )
292- lastLine. append ( . init( string: String ( removedSuffix) , attributes: [
290+ lastLine. append ( . init( string: String ( change. element) , attributes: [
293291 . foregroundColor: NSColor . systemRed. withAlphaComponent ( 0.4 ) ,
294292 . backgroundColor: NSColor . systemRed. withAlphaComponent ( 0.1 ) ,
295293 ] ) )
You can’t perform that action at this time.
0 commit comments