Documentation ¶
Index ¶
- type Model
- func (m Model) GetCursor() int
- func (m Model) GetFilePaths() []string
- func (m Model) GetSelectedFile() (os.FileInfo, error)
- func (m Model) GetTotalFiles() int
- func (m *Model) GoDown()
- func (m *Model) GoUp()
- func (m *Model) GotoBottom()
- func (m *Model) GotoTop()
- func (m *Model) SetContent(files []fs.DirEntry)
- func (m *Model) SetFilePaths(filePaths []string)
- func (m *Model) SetSize(width int)
- func (m *Model) ToggleHidden()
- func (m Model) View() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Model ¶
type Model struct { Files []fs.DirEntry FilePaths []string Width int Cursor int ShowIcons bool ShowHidden bool SelectedItemColor lipgloss.AdaptiveColor UnselectedItemColor lipgloss.AdaptiveColor }
Model is a struct to represent the properties of a dirtree.
func NewModel ¶
func NewModel(showIcons bool, selectedItemColor, unselectedItemColor lipgloss.AdaptiveColor) Model
NewModel creates a new instance of a dirtree.
func (Model) GetFilePaths ¶ added in v0.8.0
GetFilePaths returns an array of file paths.
func (Model) GetSelectedFile ¶
GetSelectedFile returns the currently selected file in the tree.
func (Model) GetTotalFiles ¶
GetTotalFiles returns the total number of files in the tree.
func (*Model) SetContent ¶
SetContent sets the files currently displayed in the tree.
func (*Model) SetFilePaths ¶ added in v0.8.0
SetFilePaths sets an array of file paths.
func (*Model) SetSize ¶ added in v0.0.6
SetSize updates the size of the dirtree, useful when resizing the terminal.
func (*Model) ToggleHidden ¶
func (m *Model) ToggleHidden()
ToggleHidden toggles the visibility of hidden files.
Click to show internal directories.
Click to hide internal directories.