@ -1014,6 +1014,11 @@ func parseHunks(curFile *DiffFile, maxLines, maxLineCharacters int, input *bufio
}
}
diffLine := & DiffLine { Type : DiffLineAdd , RightIdx : rightLine }
diffLine := & DiffLine { Type : DiffLineAdd , RightIdx : rightLine }
rightLine ++
rightLine ++
if curSection == nil {
// Create a new section to represent this hunk
curSection = & DiffSection { }
curFile . Sections = append ( curFile . Sections , curSection )
}
curSection . Lines = append ( curSection . Lines , diffLine )
curSection . Lines = append ( curSection . Lines , diffLine )
case '-' :
case '-' :
curFileLinesCount ++
curFileLinesCount ++
@ -1026,6 +1031,11 @@ func parseHunks(curFile *DiffFile, maxLines, maxLineCharacters int, input *bufio
if leftLine > 0 {
if leftLine > 0 {
leftLine ++
leftLine ++
}
}
if curSection == nil {
// Create a new section to represent this hunk
curSection = & DiffSection { }
curFile . Sections = append ( curFile . Sections , curSection )
}
curSection . Lines = append ( curSection . Lines , diffLine )
curSection . Lines = append ( curSection . Lines , diffLine )
case ' ' :
case ' ' :
curFileLinesCount ++
curFileLinesCount ++
@ -1036,6 +1046,11 @@ func parseHunks(curFile *DiffFile, maxLines, maxLineCharacters int, input *bufio
diffLine := & DiffLine { Type : DiffLinePlain , LeftIdx : leftLine , RightIdx : rightLine }
diffLine := & DiffLine { Type : DiffLinePlain , LeftIdx : leftLine , RightIdx : rightLine }
leftLine ++
leftLine ++
rightLine ++
rightLine ++
if curSection == nil {
// Create a new section to represent this hunk
curSection = & DiffSection { }
curFile . Sections = append ( curFile . Sections , curSection )
}
curSection . Lines = append ( curSection . Lines , diffLine )
curSection . Lines = append ( curSection . Lines , diffLine )
default :
default :
// This is unexpected
// This is unexpected