editpreview

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KindContext = "context"
	KindRemove  = "remove"
	KindAdd     = "add"
)

Variables

This section is empty.

Functions

func DisplayLine

func DisplayLine(row Row) int

func Marker

func Marker(row Row) string

func MetadataFromArgs

func MetadataFromArgs(args, result string) map[string]any

func MetadataFromParams

func MetadataFromParams(params map[string]any, result string) map[string]any

Types

type Hunk

type Hunk struct {
	Rows []Row `json:"rows"`
}

type Preview

type Preview struct {
	Hunks []Hunk `json:"hunks"`
}

func Build

func Build(oldString, newString, result string) *Preview

func FromMetadata

func FromMetadata(metadata map[string]any) (*Preview, bool)

type Row

type Row struct {
	Kind    string `json:"kind"`
	OldLine int    `json:"oldLine,omitempty"`
	NewLine int    `json:"newLine,omitempty"`
	Text    string `json:"text"`
}

Jump to

Keyboard shortcuts

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