Documentation
¶
Index ¶
- func FormatSize(size int64) string
- func FormatTime(t time.Time) string
- func SortEntries(entries []fs.DirEntry, mode SortMode)
- type DirLoadedMsg
- type ExecuteFileMsg
- type KeyMap
- type Model
- func (m Model) Active() bool
- func (m Model) ArchiveLabel() string
- func (m *Model) ChangeSortMode()
- func (m Model) CurrentEntry() fs.DirEntry
- func (m Model) CurrentInfo() fs.FileInfo
- func (m Model) CurrentPath() string
- func (m *Model) HandleDirLoaded(msg DirLoadedMsg)
- func (m Model) InArchive() bool
- func (m *Model) LoadDir() tea.Cmd
- func (m Model) Path() string
- func (m *Model) RestoreCursor(name string)
- func (m Model) Searching() (bool, string)
- func (m Model) SelectedPaths() []string
- func (m *Model) SetActive(active bool)
- func (m *Model) SetPath(path string)
- func (m *Model) SetSize(w, h int)
- func (m Model) ShowHidden() bool
- func (m *Model) ToggleHidden()
- func (m *Model) Update(msg tea.KeyMsg) tea.Cmd
- func (m Model) View(th theme.Theme) string
- type OpenFileMsg
- type PreviewFileMsg
- type RestoreCursorMsg
- type SortMode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatTime ¶
FormatTime returns a formatted modification time.
func SortEntries ¶
SortEntries sorts directory entries. Directories always come first.
Types ¶
type DirLoadedMsg ¶
DirLoadedMsg is sent when a directory listing completes.
type ExecuteFileMsg ¶
type ExecuteFileMsg struct {
Path string
}
ExecuteFileMsg is sent when the user wants to execute a file (Enter on executable file).
type KeyMap ¶
type KeyMap struct {
Up key.Binding
Down key.Binding
PageUp key.Binding
PageDown key.Binding
Home key.Binding
End key.Binding
GoBack key.Binding
ToggleSelect key.Binding
SelectUp key.Binding
SelectDown key.Binding
QuickSearch key.Binding
}
KeyMap defines configurable panel keybindings.
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model represents a single file panel.
func (Model) ArchiveLabel ¶
ArchiveLabel returns a display string for the archive being browsed, or "".
func (*Model) ChangeSortMode ¶
func (m *Model) ChangeSortMode()
ChangeSortMode cycles to the next sort mode and re-sorts.
func (Model) CurrentEntry ¶
CurrentEntry returns the entry under the cursor, or nil.
func (Model) CurrentInfo ¶
CurrentInfo returns the FileInfo of the entry under the cursor, or nil.
func (Model) CurrentPath ¶
CurrentPath returns the full path of the entry under the cursor. For archive browsing this returns the path within the archive, not a real filesystem path.
func (*Model) HandleDirLoaded ¶
func (m *Model) HandleDirLoaded(msg DirLoadedMsg)
HandleDirLoaded processes a completed directory load.
func (*Model) RestoreCursor ¶
RestoreCursor places cursor on the named entry (used after going up).
func (Model) SelectedPaths ¶
SelectedPaths returns full paths of all tagged files. If none are tagged, returns the current entry.
func (Model) ShowHidden ¶
ShowHidden returns the current hidden-file visibility state.
func (*Model) ToggleHidden ¶
func (m *Model) ToggleHidden()
ToggleHidden flips whether dotfiles are shown.
type OpenFileMsg ¶
type OpenFileMsg struct {
Path string
}
OpenFileMsg is sent when the user wants to open a file (Enter on file).
type PreviewFileMsg ¶
type PreviewFileMsg struct {
Path string
}
PreviewFileMsg is sent when the user wants to preview a file (Space on file).
type RestoreCursorMsg ¶
type RestoreCursorMsg struct {
Name string
}
RestoreCursorMsg requests placing the cursor on a named entry after navigation.