files

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 6, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Model

type Model struct {
	// contains filtered or unexported fields
}

Model is the files pane. It holds no client and performs no I/O; listings are set by the caller as they arrive.

func New

func New() Model

func (Model) KeyMap

func (m Model) KeyMap() table.KeyMap

KeyMap returns the pane's key bindings for the help footer.

func (Model) Selected

func (m Model) Selected() (file.Info, bool)

Selected returns the file under the cursor.

func (Model) SetDark

func (m Model) SetDark(dark bool) Model

SetDark adapts the column headers and the selection to a dark or light terminal background.

func (Model) SetErr

func (m Model) SetErr(err error) Model

SetErr shows err below the listing, which is kept so the user can still navigate away from a directory that can't be read.

func (Model) SetFiles

func (m Model) SetFiles(path string, files []file.Info) Model

SetFiles replaces the listing with the contents of directory path and clears any error.

func (Model) SetFocused added in v1.1.0

func (m Model) SetFocused(focused bool) Model

SetFocused shows the border in the accent color if the list has the focus, and in gray if the preview next to it has.

func (Model) SetSize

func (m Model) SetSize(w, h int) Model

SetSize sets the outer size of the pane, including its border.

func (Model) SetSpinner added in v1.1.0

func (m Model) SetSpinner(frame string) Model

SetSpinner shows frame in front of the title, for a listing that is loading; an empty frame hides it.

func (Model) Start

func (m Model) Start() Model

Start clears the pane for a new container.

func (Model) Update

func (m Model) Update(msg tea.Msg) (Model, tea.Cmd)

func (Model) View

func (m Model) View() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL