diffviewer

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ViewportKeyMap = viewport.KeyMap{
	HalfPageDown: key.NewBinding(
		key.WithKeys("ctrl+d"),
		key.WithHelp("ctrl+d", "scroll half page down"),
	),
	HalfPageUp: key.NewBinding(
		key.WithKeys("ctrl+u"),
		key.WithHelp("ctrl+u", "scroll half page up"),
	),
	Up: key.NewBinding(
		key.WithKeys("up", "k"),
		key.WithHelp("↑/k", "prev file"),
	),
	Down: key.NewBinding(
		key.WithKeys("down", "j"),
		key.WithHelp("↓/j", "next file"),
	),
	Bottom: key.NewBinding(
		key.WithKeys("G"),
		key.WithHelp("G", "bottom"),
	),
	Top: key.NewBinding(
		key.WithKeys("g"),
		key.WithHelp("g", "top"),
	),
	Left: key.NewBinding(
		key.WithKeys("left"),
		key.WithHelp("←", "scroll left"),
	),
	Right: key.NewBinding(
		key.WithKeys("right"),
		key.WithHelp("→", "scroll right"),
	),
}

Functions

This section is empty.

Types

type Model

type Model struct {
	common.Common
	// contains filtered or unexported fields
}

func New

func New(sideBySide bool) Model

func (*Model) ClearCache added in v0.11.0

func (m *Model) ClearCache()

func (*Model) Filtering added in v0.12.0

func (m *Model) Filtering() bool

func (Model) Init

func (m Model) Init() tea.Cmd

func (*Model) RootDiffStats added in v0.9.0

func (m *Model) RootDiffStats() (int64, int64)

func (*Model) ScrollBottom added in v0.12.0

func (m *Model) ScrollBottom()

ScrollBottom scrolls the viewport to the bottom.

func (*Model) ScrollDown added in v0.4.0

func (m *Model) ScrollDown(lines int)

ScrollDown scrolls the viewport down by the given number of lines.

func (*Model) ScrollLeft added in v0.12.0

func (m *Model) ScrollLeft(cols int)

ScrollLeft moves the viewport to the left by the given number of columns.

func (*Model) ScrollRight added in v0.12.0

func (m *Model) ScrollRight(cols int)

ScrollRight scrolls the viewport one column away from column 0.

func (*Model) ScrollTop added in v0.12.0

func (m *Model) ScrollTop()

ScrollTop scrolls the viewport to its top.

func (*Model) ScrollUp added in v0.4.0

func (m *Model) ScrollUp(lines int)

ScrollUp scrolls the viewport up by the given number of lines.

func (*Model) Searching added in v0.12.0

func (m *Model) Searching() bool

func (*Model) SelectionEnabled added in v0.12.0

func (m *Model) SelectionEnabled() bool

func (Model) SetDirPatch added in v0.8.0

func (m Model) SetDirPatch(dirPath string, files []*gitdiff.File) (Model, tea.Cmd)

func (Model) SetFilePatch

func (m Model) SetFilePatch(file *gitdiff.File) (Model, tea.Cmd)

func (*Model) SetFiltering added in v0.12.0

func (m *Model) SetFiltering()

func (*Model) SetPreamble added in v0.11.0

func (m *Model) SetPreamble(preamble string)

SetPreamble stores the preamble text (e.g. commit metadata from git show).

func (*Model) SetSelectionEnabled added in v0.12.0

func (m *Model) SetSelectionEnabled(val bool)

func (*Model) SetSideBySide added in v0.6.0

func (m *Model) SetSideBySide(sideBySide bool) tea.Cmd

SetSideBySide updates the diff view mode and re-renders.

func (*Model) SetSize

func (m *Model) SetSize(width, height int) tea.Cmd

func (Model) Update

func (m Model) Update(msg tea.Msg) (Model, tea.Cmd)

func (Model) View

func (m Model) View() string

Jump to

Keyboard shortcuts

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