Documentation ¶
Index ¶
- Constants
- type State
- func (s *State) AdjustSelectedLineIdx(change int)
- func (s *State) CalculateOrigin(currentOrigin int, bufferHeight int, numLines int) int
- func (s *State) CurrentHunkBounds() (int, int)
- func (s *State) CurrentLineNumber() int
- func (s *State) CycleHunk(forward bool)
- func (s *State) CycleLine(forward bool)
- func (s *State) CycleRange(forward bool)
- func (s *State) CycleSelection(forward bool)
- func (s *State) DragSelectLine(newSelectedLineIdx int)
- func (s *State) GetDiff() string
- func (s *State) GetSelectedLineIdx() int
- func (s *State) PlainRenderSelected() string
- func (s *State) RangeStartLineIdx() (int, bool)
- func (s *State) RenderForLineIndices(isFocused bool, includedLineIndices []int) string
- func (s *State) SelectBottom()
- func (s *State) SelectLine(newSelectedLineIdx int)
- func (s *State) SelectNewLineForRange(newSelectedLineIdx int)
- func (s *State) SelectTop()
- func (s *State) SelectedRange() (int, int)
- func (s *State) SelectingHunk() bool
- func (s *State) SelectingLine() bool
- func (s *State) SelectingRange() bool
- func (s *State) SetLineSelectMode()
- func (s *State) SetRangeIsSticky(value bool)
- func (s *State) ToggleSelectHunk()
- func (s *State) ToggleSelectRange(sticky bool)
- func (s *State) ToggleStickySelectRange()
Constants ¶
View Source
const ( LINE selectMode = iota RANGE HUNK )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type State ¶
type State struct {
// contains filtered or unexported fields
}
State represents the current state of the patch explorer context i.e. when you're staging a file or you're building a patch from an existing commit this struct holds the info about the diff you're interacting with and what's currently selected.
func (*State) AdjustSelectedLineIdx ¶
func (*State) CalculateOrigin ¶
func (*State) CurrentHunkBounds ¶
returns first and last patch line index of current hunk
func (*State) CurrentLineNumber ¶
func (*State) CycleRange ¶
This is called when we use shift+arrow to expand the range (i.e. a non-sticky range)
func (*State) CycleSelection ¶
func (*State) DragSelectLine ¶
func (*State) GetSelectedLineIdx ¶
func (*State) PlainRenderSelected ¶
func (*State) RangeStartLineIdx ¶
func (*State) RenderForLineIndices ¶
func (*State) SelectBottom ¶
func (s *State) SelectBottom()
func (*State) SelectLine ¶
For when you move the cursor without holding shift (meaning if we're in a non-sticky range select, we'll cancel it)
func (*State) SelectNewLineForRange ¶
func (*State) SelectedRange ¶
func (*State) SelectingHunk ¶
func (*State) SelectingLine ¶
func (*State) SelectingRange ¶
func (*State) SetLineSelectMode ¶
func (s *State) SetLineSelectMode()
func (*State) SetRangeIsSticky ¶
func (*State) ToggleSelectHunk ¶
func (s *State) ToggleSelectHunk()
func (*State) ToggleSelectRange ¶
func (*State) ToggleStickySelectRange ¶
func (s *State) ToggleStickySelectRange()
Click to show internal directories.
Click to hide internal directories.