Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrBreak = fmt.Errorf("break out of callback loop")
View Source
var ErrContinue = fmt.Errorf("continue to next iteration of callback loop")
Functions ¶
This section is empty.
Types ¶
type Chunk ¶
type Chunk struct { *gitdiff.TextFragment Expanded ExpansionState LineNumber int Parent *File Lines []*Line NonContextLineCount int // contains filtered or unexported fields }
func (*Chunk) ForEachNode ¶
func (*Chunk) SetSelection ¶
func (c *Chunk) SetSelection(state SelectionState)
func (*Chunk) ToggleSelection ¶
func (c *Chunk) ToggleSelection()
func (*Chunk) UpdateSelection ¶
func (chunk *Chunk) UpdateSelection()
type ChunkFunc ¶
ChunkFunc is a callback for ForEachNode. Return an error to break out of the sub-loop.
type Commit ¶
type Commit struct { Files []*File // LineMap maps line numbers (cursor positions) to selection nodes (files, chunks, lines). LineMap []Selectable // Description includes the commit details, like commit message, etc. Description string }
func (*Commit) AsPatchString ¶
func (*Commit) ForEachNode ¶
func (*Commit) GetSelectedFiles ¶
type ExpansionState ¶
type ExpansionState int
const ( Collapsed ExpansionState = iota Expanded )
func (ExpansionState) String ¶
func (e ExpansionState) String() string
type File ¶
type File struct { *gitdiff.File Expanded ExpansionState LineNumber int Chunks []*Chunk // contains filtered or unexported fields }
func (*File) SetSelection ¶
func (f *File) SetSelection(state SelectionState)
func (*File) ToggleSelection ¶
func (f *File) ToggleSelection()
func (*File) UpdateSelection ¶
func (file *File) UpdateSelection()
type Line ¶
func (*Line) SetSelection ¶
func (l *Line) SetSelection(state SelectionState)
func (*Line) ToggleSelection ¶
func (l *Line) ToggleSelection()
type LineFunc ¶
LineFunc is a callback for ForEachNode. Return an error to break out of the sub-loop.
type Selectable ¶
type Selectable interface { ToggleSelection() SetSelection(SelectionState) }
type SelectionState ¶
type SelectionState int
const ( Selected SelectionState = iota PartiallySelected Deselected )
func (SelectionState) String ¶
func (s SelectionState) String() string
func (*SelectionState) Toggle ¶
func (s *SelectionState) Toggle()
Click to show internal directories.
Click to hide internal directories.