diffview

package
v0.0.1-beta Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 11, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Row

type Row struct {
	Left  string
	Right string
	Kind  RowKind
	Meta  string // for hunk header text
}

Row represents a single visual row for side-by-side rendering.

func BuildRowsFromUnified

func BuildRowsFromUnified(unified string) []Row

BuildRowsFromUnified parses a unified diff string into side-by-side rows. It uses a simple pairing strategy within each hunk: deletions are paired with subsequent additions as replacements; any remaining lines are shown as left-only (deletions) or right-only (additions).

type RowKind

type RowKind int

RowKind represents the semantic type of a side-by-side row.

const (
	RowContext RowKind = iota
	RowAdd
	RowDel
	RowReplace
	RowHunk
	RowMeta
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL