-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathDiffLine.swift
More file actions
40 lines (35 loc) · 855 Bytes
/
DiffLine.swift
File metadata and controls
40 lines (35 loc) · 855 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//
// DiffLine.swift
// gitdiff
//
// Created by Tornike Gomareli on 18.06.25.
//
import Foundation
/// Represents a single line in a diff.
public struct DiffLine: Identifiable, Sendable {
public let id: UUID
public let type: LineType
public let content: String
public let oldLineNumber: Int?
public let newLineNumber: Int?
public init(
id: UUID = UUID(),
type: LineType,
content: String,
oldLineNumber: Int?,
newLineNumber: Int?
) {
self.id = id
self.type = type
self.content = content
self.oldLineNumber = oldLineNumber
self.newLineNumber = newLineNumber
}
/// Type of diff line.
public enum LineType: Sendable {
case added /// Line was added (+)
case removed /// Line was removed (-)
case context /// Unchanged context line
case header /// Section header
}
}