Documentation
¶
Index ¶
- type KeyMap
- type Model
- func (m *Model) ClickNode(node *tree.Node)
- func (m *Model) ClickNodeIcon(node *tree.Node)
- func (m *Model) CopyCurrNodePath() tea.Cmd
- func (m *Model) CurrNodePath() string
- func (m *Model) Down()
- func (m *Model) GetCurrNode() *tree.Node
- func (m *Model) GetCurrNodeDesendantDiffs() []*gitdiff.File
- func (m Model) GetNodeAtY(yoffset int) *tree.Node
- func (m *Model) GoToBottom()
- func (m *Model) GoToTop()
- func (m *Model) Height() int
- func (m *Model) IsDirectoryIconHit(node *tree.Node, x int) bool
- func (m *Model) NextFile() bool
- func (m *Model) NodeDescendantDiffs(node *tree.Node) []*gitdiff.File
- func (m *Model) PrevFile() bool
- func (m *Model) ScrollDown(lines int)
- func (m *Model) ScrollUp(lines int)
- func (m *Model) SetCursorByPath(path string)
- func (m *Model) SetCursorNoScroll(cursor int)
- func (m *Model) SetDarkBackground(isDark bool)
- func (m Model) SetFiles(files []*gitdiff.File) Model
- func (m *Model) SetIconStyle(iconStyle string)
- func (m *Model) SetSize(width, height int)
- func (m *Model) Up()
- func (m *Model) Update(msg tea.Msg) (*Model, tea.Cmd)
- func (m *Model) View() string
- func (m Model) ViewportYOffset() int
- func (m *Model) Width() int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
func (*Model) ClickNodeIcon ¶
ClickNodeIcon applies directory-icon click behavior to a visible tree node.
func (*Model) CopyCurrNodePath ¶
func (*Model) CurrNodePath ¶
func (*Model) GetCurrNode ¶
func (*Model) GetCurrNodeDesendantDiffs ¶
func (Model) GetNodeAtY ¶
GetNodeAtY returns the tree's node at the Y scroll offset.
func (*Model) GoToBottom ¶
func (m *Model) GoToBottom()
func (*Model) IsDirectoryIconHit ¶
IsDirectoryIconHit reports whether x, relative to the left edge of the file tree, lands on the visible directory disclosure icon for node.
func (*Model) NodeDescendantDiffs ¶
NodeDescendantDiffs returns the files under node without depending on the node's current open/closed render state.
func (*Model) ScrollDown ¶
ScrollDown scrolls the viewport down by the given number of lines.
func (*Model) SetCursorByPath ¶
func (*Model) SetCursorNoScroll ¶
SetCursorNoScroll updates the selected file without scrolling the viewport. Use this when the user clicks on a file they can already see.
func (*Model) SetDarkBackground ¶
func (*Model) SetIconStyle ¶
SetIconStyle changes the icon style and regenerates the tree.
func (Model) ViewportYOffset ¶
ViewportYOffset returns the tree's current Y scroll offset.