preview

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: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyMap

type KeyMap struct {
	viewport.KeyMap
	Top    key.Binding
	Bottom key.Binding
}

KeyMap extends the viewport keys with jumps to the start and end.

type Model

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

Model is the preview pane of the files page. It holds no client and performs no I/O; the content is set by the caller as it arrives.

func New

func New() Model

func (Model) KeyMap

func (m Model) KeyMap() KeyMap

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

func (Model) Loading

func (m Model) Loading() bool

Loading reports whether the pane waits for the content of its file.

func (Model) SetContent

func (m Model) SetContent(data []byte, truncated bool) Model

SetContent shows the first bytes of the file; truncated reports that the file is longer.

func (Model) SetErr

func (m Model) SetErr(err error) Model

SetErr shows err in place of the content.

func (Model) SetFocused

func (m Model) SetFocused(focused bool) Model

SetFocused shows the border in the accent color if the pane has the focus, and in gray if the files list 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

func (m Model) SetSpinner(frame string) Model

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

func (Model) Start

func (m Model) Start(f file.Info) Model

Start clears the pane for file f, which is loading.

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