Documentation
¶
Index ¶
- type LineIndex
- type MatchRange
- type Model
- func (m *Model) IsSideBySide() bool
- func (m *Model) Scroll(delta int)
- func (m *Model) ScrollFullPageDown(viewHeight int)
- func (m *Model) ScrollFullPageUp(viewHeight int)
- func (m *Model) ScrollHalfPageDown(viewHeight int)
- func (m *Model) ScrollHalfPageUp(viewHeight int)
- func (m *Model) SetFileChange(file diff.FileChange)
- func (m *Model) SetSearchState(isSearching bool, getMatches func(hunkIdx, lineIdx int) []MatchRange)
- func (m *Model) SetSelection(selectedHunk int, isSelected func(hunkIdx int) bool)
- func (m *Model) SetTagState(getHunkTags func(hunkIdx int) []SplitTag)
- func (m *Model) SetVisualState(lineCursor int, isVisualMode bool, visualAnchor int, ...)
- func (m *Model) ShowLineNumbers() bool
- func (m *Model) ShowWhitespace() bool
- func (m *Model) ToggleLineNumbers()
- func (m *Model) ToggleSideBySide()
- func (m *Model) ToggleWhitespace()
- func (m *Model) ToggleWordDiff()
- func (m Model) View(width, height int, focused bool) string
- func (m *Model) WordLevelDiff() bool
- type RenderContext
- type SideBySideView
- type SplitTag
- type ViewMode
- type ViewModeType
- type WordDiffCache
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LineIndex ¶
func (*LineIndex) FindHunkForOffset ¶
type MatchRange ¶
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
func (*Model) IsSideBySide ¶
func (*Model) ScrollFullPageDown ¶
func (*Model) ScrollFullPageUp ¶
func (*Model) ScrollHalfPageDown ¶
func (*Model) ScrollHalfPageUp ¶
func (*Model) SetFileChange ¶
func (m *Model) SetFileChange(file diff.FileChange)
func (*Model) SetSearchState ¶
func (m *Model) SetSearchState( isSearching bool, getMatches func(hunkIdx, lineIdx int) []MatchRange, )
func (*Model) SetSelection ¶
func (*Model) SetTagState ¶
func (*Model) SetVisualState ¶
func (*Model) ShowLineNumbers ¶
func (*Model) ShowWhitespace ¶
func (*Model) ToggleLineNumbers ¶
func (m *Model) ToggleLineNumbers()
func (*Model) ToggleSideBySide ¶
func (m *Model) ToggleSideBySide()
func (*Model) ToggleWhitespace ¶
func (m *Model) ToggleWhitespace()
func (*Model) ToggleWordDiff ¶
func (m *Model) ToggleWordDiff()
func (*Model) WordLevelDiff ¶
type RenderContext ¶
type RenderContext struct {
Focused bool
Height int
IsLineSelected func(hunkIdx, lineIdx int) bool
IsSearching bool
IsSelected func(hunkIdx int) bool
IsVisualMode bool
GetMatches func(hunkIdx, lineIdx int) []MatchRange
LineCursor int
SelectedHunk int
ShowLineNumbers bool
ShowWhitespace bool
TabWidth int
VisualAnchor int
Width int
WordDiffCache *WordDiffCache
WordLevelDiff bool
}
type SideBySideView ¶
type SideBySideView struct{}
func NewSideBySideView ¶
func NewSideBySideView() *SideBySideView
func (*SideBySideView) Render ¶
func (v *SideBySideView) Render(file *diff.FileChange, ctx RenderContext) string
func (*SideBySideView) SupportsSelection ¶
func (v *SideBySideView) SupportsSelection() bool
type ViewMode ¶
type ViewMode interface {
Render(file *diff.FileChange, ctx RenderContext) string
SupportsSelection() bool
}
type ViewModeType ¶
type ViewModeType string
const ( ViewModeUnified ViewModeType = "unified" ViewModeSideBySide ViewModeType = "side-by-side" )
type WordDiffCache ¶
type WordDiffCache struct {
HunkDiffs map[int]map[int]diff.WordDiffResult
}
Click to show internal directories.
Click to hide internal directories.