filetree

package
v0.0.0-...-1b2216e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 29, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyMap

type KeyMap struct {
	ExpandNode   key.Binding
	CollapseNode key.Binding
	ToggleNode   key.Binding
}

type Model

type Model struct {
	// contains filtered or unexported fields
}

func New

func New(cfg config.Config) Model

func (*Model) ClickNode

func (m *Model) ClickNode(node *tree.Node)

ClickNode applies row-click behavior to a visible tree node.

func (*Model) ClickNodeIcon

func (m *Model) ClickNodeIcon(node *tree.Node)

ClickNodeIcon applies directory-icon click behavior to a visible tree node.

func (*Model) CopyCurrNodePath

func (m *Model) CopyCurrNodePath() tea.Cmd

func (*Model) CurrNodePath

func (m *Model) CurrNodePath() string

func (*Model) Down

func (m *Model) Down()

func (*Model) GetCurrNode

func (m *Model) GetCurrNode() *tree.Node

func (*Model) GetCurrNodeDesendantDiffs

func (m *Model) GetCurrNodeDesendantDiffs() []*gitdiff.File

func (Model) GetNodeAtY

func (m Model) GetNodeAtY(yoffset int) *tree.Node

GetNodeAtY returns the tree's node at the Y scroll offset.

func (*Model) GoToBottom

func (m *Model) GoToBottom()

func (*Model) GoToTop

func (m *Model) GoToTop()

func (*Model) Height

func (m *Model) Height() int

func (*Model) IsDirectoryIconHit

func (m *Model) IsDirectoryIconHit(node *tree.Node, x int) bool

IsDirectoryIconHit reports whether x, relative to the left edge of the file tree, lands on the visible directory disclosure icon for node.

func (*Model) NextFile

func (m *Model) NextFile() bool

NextFile moves the cursor to the next file node, skipping directories.

func (*Model) NodeDescendantDiffs

func (m *Model) NodeDescendantDiffs(node *tree.Node) []*gitdiff.File

NodeDescendantDiffs returns the files under node without depending on the node's current open/closed render state.

func (*Model) PrevFile

func (m *Model) PrevFile() bool

PrevFile moves the cursor to the previous file node, skipping directories.

func (*Model) ScrollDown

func (m *Model) ScrollDown(lines int)

ScrollDown scrolls the viewport down by the given number of lines.

func (*Model) ScrollUp

func (m *Model) ScrollUp(lines int)

ScrollUp scrolls the viewport up by the given number of lines.

func (*Model) SetCursorByPath

func (m *Model) SetCursorByPath(path string)

func (*Model) SetCursorNoScroll

func (m *Model) SetCursorNoScroll(cursor int)

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 (m *Model) SetDarkBackground(isDark bool)

func (Model) SetFiles

func (m Model) SetFiles(files []*gitdiff.File) Model

func (*Model) SetIconStyle

func (m *Model) SetIconStyle(iconStyle string)

SetIconStyle changes the icon style and regenerates the tree.

func (*Model) SetSize

func (m *Model) SetSize(width, height int)

SetSize implements the Component interface.

func (*Model) Up

func (m *Model) Up()

func (*Model) Update

func (m *Model) Update(msg tea.Msg) (*Model, tea.Cmd)

func (*Model) View

func (m *Model) View() string

func (Model) ViewportYOffset

func (m Model) ViewportYOffset() int

ViewportYOffset returns the tree's current Y scroll offset.

func (*Model) Width

func (m *Model) Width() int

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL