Documentation ¶
Index ¶
- Constants
- type DirectoryItem
- type Model
- func (m *Model) CreateDirectoryCmd(name string) tea.Cmd
- func (m *Model) CreateFileCmd(name string) tea.Cmd
- func (m Model) GetDirectoryListingCmd(directoryName string) tea.Cmd
- func (m Model) GetSelectedItem() DirectoryItem
- func (m Model) GetTotalItems() int
- func (m Model) Init() tea.Cmd
- func (m Model) MoveDirectoryItemCmd(source, destination string) tea.Cmd
- func (m *Model) NewStatusMessageCmd(s string) tea.Cmd
- func (m *Model) RenameDirectoryItemCmd(originalName, newName string) tea.Cmd
- func (m *Model) SetDisabled(disabled bool)
- func (m *Model) SetSelectionPath(path string)
- func (m *Model) SetShowIcons(show bool)
- func (m *Model) SetSize(width, height int)
- func (m *Model) SetTheme(selectedItemColor, unselectedItemColor lipgloss.AdaptiveColor)
- func (m Model) Update(msg tea.Msg) (Model, tea.Cmd)
- func (m Model) View() string
Constants ¶
const ( IdleState treeState = iota CreateFileState CreateDirectoryState MoveState RenameState )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DirectoryItem ¶
type Model ¶
type Model struct { Cursor int Disabled bool StatusMessage string StatusMessageLifetime time.Duration CurrentDirectory string State treeState // contains filtered or unexported fields }
func (*Model) CreateDirectoryCmd ¶
CreateDirectoryCmd creates a directory based on the name provided.
func (*Model) CreateFileCmd ¶
CreateFileCmd creates a file based on the name provided.
func (Model) GetDirectoryListingCmd ¶
GetDirectoryListingCmd updates the directory listing based on the name of the directory provided.
func (Model) GetSelectedItem ¶
func (m Model) GetSelectedItem() DirectoryItem
GetSelectedItem returns the currently selected file/dir.
func (Model) GetTotalItems ¶
GetTotalItems returns total number of tree items.
func (Model) MoveDirectoryItemCmd ¶
MoveDirectoryItemCmd moves an item from one place to another.
func (*Model) NewStatusMessageCmd ¶
NewStatusMessageCmd sets a new status message, which will show for a limited amount of time. Note that this also returns a command.
func (*Model) RenameDirectoryItemCmd ¶
RenameDirectoryItemCmd renames a file or folder given a name.
func (*Model) SetDisabled ¶
SetDisabled sets if the bubble is currently active.
func (*Model) SetSelectionPath ¶
SetSelectionPath sets the selection path to be written.
func (*Model) SetShowIcons ¶
SetShowIcons sets whether icons will show or not.
func (*Model) SetTheme ¶
func (m *Model) SetTheme(selectedItemColor, unselectedItemColor lipgloss.AdaptiveColor)
SetTheme sets the theme of the tree.