Documentation ¶
Overview ¶
Package filetree implements a filetree bubble which can be used to navigate the filesystem and perform actions on files and directories.
Index ¶
- func ConvertBytesToSizeString(size int64) string
- type Bubble
- func (b Bubble) Cursor() int
- func (b Bubble) GetSelectedItem() Item
- func (b Bubble) Init() tea.Cmd
- func (b Bubble) IsFiltering() bool
- func (b *Bubble) SetBorderColor(color lipgloss.AdaptiveColor)
- func (b *Bubble) SetBorderless(borderless bool)
- func (b *Bubble) SetIsActive(active bool)
- func (b *Bubble) SetSelectedItemColors(foreground lipgloss.AdaptiveColor)
- func (b *Bubble) SetSelectionPath(path string)
- func (b *Bubble) SetSize(width, height int)
- func (b *Bubble) SetStartDir(dir string)
- func (b *Bubble) SetTitleColors(foreground, background lipgloss.AdaptiveColor)
- func (b *Bubble) ToggleHelp(showHelp bool)
- func (b *Bubble) ToggleShowIcons(showIcons bool) tea.Cmd
- func (b Bubble) TotalItems() int
- func (b Bubble) Update(msg tea.Msg) (Bubble, tea.Cmd)
- func (b Bubble) View() string
- type Item
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertBytesToSizeString ¶
ConvertBytesToSizeString converts a byte count to a human readable string.
Types ¶
type Bubble ¶
type Bubble struct {
// contains filtered or unexported fields
}
Bubble represents the properties of a filetree.
func New ¶
func New( active, borderless bool, startDir, selectionPath string, borderColor, selectedItemColor, titleBackgroundColor, titleForegroundColor lipgloss.AdaptiveColor, ) Bubble
New creates a new instance of a filetree.
func (Bubble) GetSelectedItem ¶
GetSelectedItem returns the currently selected item in the tree.
func (Bubble) IsFiltering ¶
IsFiltering returns if the tree is currently being filtered.
func (*Bubble) SetBorderColor ¶
func (b *Bubble) SetBorderColor(color lipgloss.AdaptiveColor)
SetBorderColor sets the color of the border.
func (*Bubble) SetBorderless ¶
SetBorderless sets weather or not to show the border.
func (*Bubble) SetIsActive ¶
SetIsActive sets if the bubble is currently active.
func (*Bubble) SetSelectedItemColors ¶
func (b *Bubble) SetSelectedItemColors(foreground lipgloss.AdaptiveColor)
SetSelectedItemColors sets the foreground of the selected item.
func (*Bubble) SetSelectionPath ¶
SetSelectionPath sets the path in which to write to a file when editing.
func (*Bubble) SetStartDir ¶
SetStartDir sets a starting directory.
func (*Bubble) SetTitleColors ¶
func (b *Bubble) SetTitleColors(foreground, background lipgloss.AdaptiveColor)
SetTitleColors sets the background and foreground of the title.
func (*Bubble) ToggleHelp ¶
ToggleHelp sets weather or not to show the help section.
func (*Bubble) ToggleShowIcons ¶
ToggleShowIcons sets weather or not to show icons.
func (Bubble) TotalItems ¶
TotalItems returns the total number of items in the tree.
type Item ¶
type Item struct {
// contains filtered or unexported fields
}
Item represents a list item.
func (Item) CurrentDirectory ¶
CurrentDirectory returns the current directory of the tree.
func (Item) Description ¶
Description returns the description of the list item.
func (Item) FileExtension ¶
FileExtension returns the extension of the list item.
func (Item) FilterValue ¶
FilterValue returns the current filter value.
func (Item) IsDirectory ¶
IsDirectory returns true if the list item is a directory.