Documentation
¶
Index ¶
- func BuildHunkPatch(parsed ParsedDiff, hunkIndex int) (string, error)
- func BuildLineRangePatch(parsed ParsedDiff, startChanged, endChanged int) (string, error)
- func BuildRawToDisplayMap(parsed ParsedDiff, displayToRaw []int) []int
- func BuildSingleLinePatch(parsed ParsedDiff, changedIndex int) (string, error)
- func CleanHunkHeader(line string) string
- func DiffBodyPadding(kind RowKind, width int) string
- func HasBinaryDiff(parsed ParsedDiff) bool
- func SanitizeANSIInline(s string) string
- func SectionHasBinaryDiff(parsed ParsedDiff) bool
- func StripUnifiedVisibleMarker(line string, marker byte) string
- func WrapANSI(s string, width int) []string
- type ChangedLine
- type ParsedDiff
- type ParsedHunk
- type RowKind
- type SymlinkDiffInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildHunkPatch ¶
func BuildHunkPatch(parsed ParsedDiff, hunkIndex int) (string, error)
func BuildLineRangePatch ¶
func BuildLineRangePatch(parsed ParsedDiff, startChanged, endChanged int) (string, error)
func BuildRawToDisplayMap ¶
func BuildRawToDisplayMap(parsed ParsedDiff, displayToRaw []int) []int
func BuildSingleLinePatch ¶
func BuildSingleLinePatch(parsed ParsedDiff, changedIndex int) (string, error)
func CleanHunkHeader ¶
func DiffBodyPadding ¶
func HasBinaryDiff ¶
func HasBinaryDiff(parsed ParsedDiff) bool
func SanitizeANSIInline ¶
func SectionHasBinaryDiff ¶
func SectionHasBinaryDiff(parsed ParsedDiff) bool
Types ¶
type ChangedLine ¶
type ParsedDiff ¶
type ParsedDiff struct {
FileHeader []string
Lines []string
Hunks []ParsedHunk
Changed []ChangedLine
}
func ParseUnifiedDiff ¶
func ParseUnifiedDiff(raw string) ParsedDiff
type ParsedHunk ¶
type RowKind ¶
type RowKind int
func BuildDisplayBaseLines ¶
func BuildDisplayBaseLines(parsed ParsedDiff, colorLines []string) (lines []string, kinds []RowKind, displayToRaw []int)
type SymlinkDiffInfo ¶
type SymlinkDiffInfo struct {
IsSymlink bool
WasSymlink bool
IsNowSymlink bool
TypeChange bool
OldTarget string
NewTarget string
}
func ParseSymlinkDiffInfo ¶
func ParseSymlinkDiffInfo(parsed ParsedDiff) SymlinkDiffInfo
func (SymlinkDiffInfo) Summary ¶
func (si SymlinkDiffInfo) Summary() string
func (SymlinkDiffInfo) TitleLabel ¶
func (si SymlinkDiffInfo) TitleLabel() string
Click to show internal directories.
Click to hide internal directories.