Skip to content

Commit 7290b2a

Browse files
committed
Fix offset
1 parent b79e344 commit 7290b2a

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

Tool/Sources/CodeDiff/CodeDiff.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,8 @@ public struct CodeDiff {
156156

157157
// handle lines before sections
158158
var beforeSection = SnippetDiff.Section(
159-
oldOffset: 0,
160-
newOffset: 0,
159+
oldOffset: oldLineIndex,
160+
newOffset: newLineIndex,
161161
oldSnippet: [],
162162
newSnippet: []
163163
)
@@ -188,8 +188,8 @@ public struct CodeDiff {
188188
// handle lines inside sections
189189

190190
var insideSection = SnippetDiff.Section(
191-
oldOffset: removalSection?.offset ?? 0,
192-
newOffset: insertionSection?.offset ?? 0,
191+
oldOffset: oldLineIndex,
192+
newOffset: newLineIndex,
193193
oldSnippet: [],
194194
newSnippet: []
195195
)

0 commit comments

Comments
 (0)