Documentation
¶
Overview ¶
Package filetree implements the file explorer panel for grut. It provides a navigable tree view of the filesystem with lazy directory loading, symlink safety, icon support, and cursor-based navigation.
Package filetree provides the file tree panel for grut.
Package filetree provides file operation helpers for the grut file explorer. All operations validate that paths stay within the tree's root directory (path jailing) to prevent directory-traversal attacks.
Package filetree provides a filesystem watcher for the grut file explorer. It uses fsnotify for event-based watching with a debounce window, and falls back to polling when fsnotify is unavailable or fails.
Index ¶
- type DirChangedMsg
- type FileTree
- func (ft *FileTree) Blur()
- func (ft *FileTree) Close()
- func (ft *FileTree) Focus()
- func (ft *FileTree) Init(ctx context.Context) tea.Cmd
- func (ft *FileTree) KeyBindings() []panels.KeyBinding
- func (ft *FileTree) SetActionsCfg(cfg config.ActionsConfig)
- func (ft *FileTree) SetGitClient(gc git.StatusReader)
- func (ft *FileTree) SetSize(width, height int)
- func (ft *FileTree) Title() string
- func (ft *FileTree) Update(msg tea.Msg) (panels.Panel, tea.Cmd)
- func (ft *FileTree) View(width, height int) string
- type RefreshMsg
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DirChangedMsg ¶
type DirChangedMsg struct{ Path string }
Messages emitted by the filetree panel. DirChangedMsg is sent when a directory is expanded.
type FileTree ¶
type FileTree struct {
// contains filtered or unexported fields
}
FileTree is the file explorer panel. It implements panels.Panel.
func New ¶
func New(cfg config.FileTreeConfig, rootPath string) *FileTree
New creates a new FileTree panel rooted at rootPath.
func (*FileTree) Close ¶
func (ft *FileTree) Close()
Close implements panels.Closer. It stops the filesystem watcher and releases associated resources (F29).
func (*FileTree) Init ¶
--------------------------------------------------------------------------- panels.Panel interface --------------------------------------------------------------------------- Init implements panels.Panel.
func (*FileTree) KeyBindings ¶
func (ft *FileTree) KeyBindings() []panels.KeyBinding
KeyBindings implements panels.Panel.
func (*FileTree) SetActionsCfg ¶
func (ft *FileTree) SetActionsCfg(cfg config.ActionsConfig)
SetActionsCfg stores the actions configuration for right-click menus.
func (*FileTree) SetGitClient ¶
func (ft *FileTree) SetGitClient(gc git.StatusReader)
SetGitClient configures the filetree with a git client for git-aware filtering. When set, the user can press "g" to toggle between all files and only git-changed files.
type RefreshMsg ¶
type RefreshMsg struct{}
RefreshMsg tells the filetree to reload its directory listing.