internal

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package internal defines shared diff model types used across the application.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DiffHunk

type DiffHunk struct {
	Header string
	// OldStartLine is the first line number in the old-file range from the hunk header.
	OldStartLine int
	// StartLine is the first line number in the new-file range from the hunk header.
	StartLine int
	Lines     []DiffLine
}

DiffHunk stores one @@ block from a unified diff.

type DiffLine

type DiffLine struct {
	Type    LineType
	Content string
	// OldLineNo is the source file line number for deleted or context lines.
	OldLineNo int
	// NewLineNo is the destination file line number for added or context lines.
	NewLineNo int
}

DiffLine stores one rendered diff line without the +/- prefix.

type FileDiff

type FileDiff struct {
	Path     string
	Status   FileStatus
	Hunks    []DiffHunk
	AddCount int
	DelCount int
	IsBinary bool
}

FileDiff stores the parsed diff for one file.

type FileStatus

type FileStatus int

FileStatus marks the kind of change for a file.

const (
	// StatusModified means the file existed before and changed.
	StatusModified FileStatus = iota
	// StatusAdded means the file is new relative to baseline.
	StatusAdded
	// StatusDeleted means the file was removed relative to baseline.
	StatusDeleted
	// StatusBinary means the file changed but should not render textual hunks.
	StatusBinary
)

type LineType

type LineType int

LineType marks the semantic type of a diff line.

const (
	// LineContext keeps unchanged context around a hunk.
	LineContext LineType = iota
	// LineAdd marks an added line.
	LineAdd
	// LineDel marks a deleted line.
	LineDel
)

Directories

Path Synopsis
Package git provides repository discovery and diff computation helpers.
Package git provides repository discovery and diff computation helpers.
Package ui renders the diffpane Bubble Tea interface and its supporting views.
Package ui renders the diffpane Bubble Tea interface and its supporting views.
Package watcher provides fsnotify-based file watching with debounce logic.
Package watcher provides fsnotify-based file watching with debounce logic.

Jump to

Keyboard shortcuts

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