Documentation
¶
Index ¶
- func LoadChildren(projectPath, parentPath string, depth int, opts LoadOptions, ...) tea.Cmd
- func LoadFileTree(projectPath string, opts LoadOptions) tea.Cmd
- func LoadFilteredTree(projectPath, query string, opts LoadOptions, statuses map[string]GitFileStatus) tea.Cmd
- func LoadGitStatus(projectPath string) tea.Cmd
- type Component
- type FileNode
- type FileSelectedMsg
- type FileTree
- func (t *FileTree) BindingKeys() []key.Binding
- func (t *FileTree) GetSize() (int, int)
- func (t *FileTree) Init() tea.Cmd
- func (t *FileTree) SelectedFile() string
- func (t *FileTree) SetShowHidden(show bool) tea.Cmd
- func (t *FileTree) SetSize(width, height int) tea.Cmd
- func (t *FileTree) ShowHidden() bool
- func (t *FileTree) ToggleHidden() tea.Cmd
- func (t *FileTree) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (t *FileTree) View() string
- type FileTreeRefreshMsg
- type FilterResultsMsg
- type GitFileStatus
- type GitStatusUpdateMsg
- type KeyMap
- type LoadChildrenMsg
- type LoadOptions
- type Option
- type SetShowHiddenMsg
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadChildren ¶
func LoadChildren(projectPath, parentPath string, depth int, opts LoadOptions, statuses map[string]GitFileStatus) tea.Cmd
func LoadFileTree ¶
func LoadFileTree(projectPath string, opts LoadOptions) tea.Cmd
func LoadFilteredTree ¶
func LoadFilteredTree(projectPath, query string, opts LoadOptions, statuses map[string]GitFileStatus) tea.Cmd
func LoadGitStatus ¶
Types ¶
type Component ¶
type Component interface {
tea.Model
layout.Sizeable
layout.Bindings
SelectedFile() string
// ShowHidden reports whether hidden files/directories are currently shown.
ShowHidden() bool
// SetShowHidden sets the hidden-files visibility and reloads the tree.
SetShowHidden(show bool) tea.Cmd
// ToggleHidden flips the hidden-files visibility and reloads the tree.
ToggleHidden() tea.Cmd
}
type FileNode ¶
type FileNode struct {
Name string
Path string
IsDir bool
IsExpanded bool
Children []*FileNode
GitStatus GitFileStatus
Depth int
Icon string
Loaded bool
}
func NewFileNode ¶
func NewFileNode(name, path string, isDir bool, depth int, status GitFileStatus) *FileNode
func NewRootNode ¶
func (*FileNode) SetExpanded ¶
type FileSelectedMsg ¶
type FileTree ¶
type FileTree struct {
// contains filtered or unexported fields
}
func (*FileTree) BindingKeys ¶
func (*FileTree) SelectedFile ¶
func (*FileTree) SetShowHidden ¶ added in v0.500.0
SetShowHidden sets the hidden-files visibility and reloads the tree (keeping any active fuzzy filter). It is a no-op when the value is unchanged.
func (*FileTree) ShowHidden ¶ added in v0.500.0
ShowHidden reports whether hidden files/directories are currently shown.
func (*FileTree) ToggleHidden ¶ added in v0.500.0
ToggleHidden flips the hidden-files visibility and reloads the tree.
type FileTreeRefreshMsg ¶
type FilterResultsMsg ¶
type GitFileStatus ¶
type GitFileStatus int
const ( GitStatusClean GitFileStatus = iota GitStatusModified GitStatusAdded GitStatusDeleted GitStatusUntracked GitStatusRenamed )
func MergeGitStatus ¶
func MergeGitStatus(current, next GitFileStatus) GitFileStatus
func (GitFileStatus) Priority ¶
func (s GitFileStatus) Priority() int
type GitStatusUpdateMsg ¶
type GitStatusUpdateMsg struct {
Statuses map[string]GitFileStatus
Err error
}
type KeyMap ¶
type KeyMap struct {
Up key.Binding
Down key.Binding
Expand key.Binding
Collapse key.Binding
Open key.Binding
Search key.Binding
Refresh key.Binding
CancelSearch key.Binding
NewFile key.Binding
}
func DefaultKeyMap ¶
func DefaultKeyMap() KeyMap
type LoadChildrenMsg ¶
type LoadOptions ¶
type LoadOptions struct {
ShowHidden bool
}
type SetShowHiddenMsg ¶ added in v0.500.0
type SetShowHiddenMsg struct {
ShowHidden bool
}
SetShowHiddenMsg requests the file tree to update its hidden-files visibility and reload. It is broadcast (e.g. from the settings page) so the live tree reflects a config change without a restart.
Click to show internal directories.
Click to hide internal directories.