Documentation
¶
Index ¶
- func ActiveHunkIndexForYank(section DiffData, navMode NavMode) int
- func ChangedLineNumberForYank(cl ChangedLineLike) int
- func FocusedLineSpanForYank(section DiffData, navMode NavMode) (int, int)
- func FocusedLocation(section DiffData, navMode NavMode) string
- func FocusedYankBody(section DiffData, navMode NavMode) []string
- func FormatYankAllContext(path, loc string, body []string) string
- func FormatYankLocation(path, loc string) string
- type ChangedLineLike
- type DiffData
- type DiffSearchMatch
- type FocusedYankError
- type Model
- func (m Model) ActiveRawLineIndex() int
- func (m *Model) ApplySearchMatch(match search.Match)
- func (m *Model) BuildFromRaw(raw, color string)
- func (m Model) ComputeSearchMatches(query string) []DiffSearchMatch
- func (m Model) CurrentSearchCursor(matches []search.Match) int
- func (m Model) CurrentSearchMatchIndex(matches []DiffSearchMatch) int
- func (m Model) Data() DiffData
- func (m *Model) DataRef() *DiffData
- func (m *Model) EnableWrap(enabled bool)
- func (m *Model) EnsureActiveVisible(navMode NavMode)
- func (m *Model) FocusSearchMatch(match search.Match)
- func (m Model) FocusedLocationAndBody() (string, []string, FocusedYankError)
- func (m Model) Init() tea.Cmd
- func (m Model) IsSideBySide() bool
- func (m *Model) JumpBottom() bool
- func (m *Model) JumpTop() bool
- func (m *Model) MoveActive(delta int, allowViewportScroll bool) bool
- func (m Model) NavMode() NavMode
- func (m *Model) Reflow(wrapWidth int)
- func (m Model) RenderMode() RenderMode
- func (m *Model) RestoreViewportYOffset(y int)
- func (m *Model) ScrollPage(delta int)
- func (m *Model) ScrollViewport(delta int)
- func (m *Model) Search() *search.Model
- func (m *Model) SetData(data DiffData)
- func (m *Model) SetNavMode(mode NavMode)
- func (m *Model) SetRenderMode(mode RenderMode)
- func (m *Model) SyncViewport(width, height int)
- func (m Model) Update(msg tea.Msg) (Model, tea.Cmd, bool)
- func (m *Model) Viewport() *viewport.Model
- func (m *Model) VisibleRows(bodyH int, active bool) []VisibleDiffRow
- func (m Model) WrapEnabled() bool
- type NavMode
- type RenderMode
- type SideBySideMapping
- type VisibleDiffRow
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ActiveHunkIndexForYank ¶ added in v0.14.1
func ChangedLineNumberForYank ¶ added in v0.14.1
func ChangedLineNumberForYank(cl ChangedLineLike) int
func FocusedLineSpanForYank ¶ added in v0.14.1
func FocusedLocation ¶ added in v0.14.1
func FocusedYankBody ¶ added in v0.14.1
func FormatYankAllContext ¶ added in v0.14.1
func FormatYankLocation ¶ added in v0.14.1
Types ¶
type ChangedLineLike ¶ added in v0.14.1
type DiffData ¶ added in v0.14.1
type DiffData struct {
RawLines []string
BaseLines []string
BaseLineKinds []diffrender.RowKind
BaseDisplayToRaw []int
ViewLines []string
ViewLineKinds []diffrender.RowKind
DisplayToRaw []int
RawToDisplay []int
HunkDisplayRange [][2]int
ChangedDisplay []int
Parsed diffcore.ParsedDiff
ActiveHunk int
ActiveLine int
VisualActive bool
VisualAnchor int
}
DiffData contains the complete per-pane diff state: parsed diff, rendered lines/mappings, and active selection/cursor.
func BuildDiffData ¶ added in v0.14.1
func NewDiffData ¶ added in v0.14.1
func NewDiffData() DiffData
func (DiffData) ActiveRawLineIndex ¶ added in v0.14.1
func (*DiffData) HasContent ¶ added in v0.14.1
func (DiffData) HunkDisplayBounds ¶ added in v0.14.1
func (DiffData) VisualLineBounds ¶ added in v0.14.1
type DiffSearchMatch ¶ added in v0.14.1
type FocusedYankError ¶ added in v0.14.1
type FocusedYankError string
const ( FocusedYankErrNoHunk FocusedYankError = "no hunk selected" FocusedYankErrNoLines FocusedYankError = "no lines to yank" )
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model owns one diff pane state (unstaged or staged), including local search.
func (Model) ActiveRawLineIndex ¶ added in v0.14.1
func (*Model) ApplySearchMatch ¶ added in v0.14.1
func (*Model) BuildFromRaw ¶
func (Model) ComputeSearchMatches ¶ added in v0.14.1
func (m Model) ComputeSearchMatches(query string) []DiffSearchMatch
func (Model) CurrentSearchCursor ¶ added in v0.14.1
func (Model) CurrentSearchMatchIndex ¶ added in v0.14.1
func (m Model) CurrentSearchMatchIndex(matches []DiffSearchMatch) int
func (*Model) EnableWrap ¶ added in v0.14.1
func (*Model) EnsureActiveVisible ¶ added in v0.14.1
func (*Model) FocusSearchMatch ¶ added in v0.14.1
func (Model) FocusedLocationAndBody ¶ added in v0.14.1
func (m Model) FocusedLocationAndBody() (string, []string, FocusedYankError)
func (Model) IsSideBySide ¶ added in v0.14.1
func (*Model) JumpBottom ¶ added in v0.14.1
func (*Model) MoveActive ¶ added in v0.14.1
func (Model) RenderMode ¶ added in v0.14.1
func (m Model) RenderMode() RenderMode
func (*Model) RestoreViewportYOffset ¶ added in v0.14.1
func (*Model) ScrollPage ¶ added in v0.14.1
ScrollPage scrolls the viewport by delta display lines and co-scrolls the active hunk/line to the nearest one at the new display position (vim-style ctrl+d/ctrl+u). In unified mode (HunkDisplayRange/ChangedDisplay are nil) only the viewport scrolls.
func (*Model) ScrollViewport ¶ added in v0.14.6
func (*Model) SetNavMode ¶ added in v0.14.1
func (*Model) SetRenderMode ¶ added in v0.14.1
func (m *Model) SetRenderMode(mode RenderMode)
func (*Model) SyncViewport ¶ added in v0.14.1
func (*Model) VisibleRows ¶ added in v0.14.1
func (m *Model) VisibleRows(bodyH int, active bool) []VisibleDiffRow
func (Model) WrapEnabled ¶ added in v0.14.1
type RenderMode ¶ added in v0.14.1
type RenderMode int
const ( RenderModeUnified RenderMode = iota RenderModeSideBySide )
type SideBySideMapping ¶ added in v0.14.1
Source Files
¶
Click to show internal directories.
Click to hide internal directories.