filemodel

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FileModelMinHeight      = filepanel.MinHeight
	FileModelMinWidth       = filepanel.MinWidth
	FilePreviewResizingText = "Resizing..."
	FilePreviewLoadingText  = "Loading..."
)

Now they are same doesn't means that they will be forever. Explicitly stating here tells that they are derived from same source, but have inherently different meaning

Variables

View Source
var ErrMaximumPanelCount = errors.New("maximum panel count reached")
View Source
var ErrMinimumPanelCount = errors.New("minimum panel count reached")

Functions

This section is empty.

Types

type Model

type Model struct {
	FilePanels           []filepanel.Model
	SinglePanelWidth     int
	Width                int
	ExpectedPreviewWidth int
	Height               int
	Renaming             bool
	MaxFilePanel         int
	FilePreview          preview.Model
	FocusedPanelIndex    int
	// contains filtered or unexported fields
}

TODO: Make the fields unexported, as much as possible some fields like `Width` should not be updated directly, only via Set functions. Having them exported is dangerous

func (*Model) CloseFilePanel

func (m *Model) CloseFilePanel() (tea.Cmd, error)

func (*Model) CreateNewFilePanel

func (m *Model) CreateNewFilePanel(location string) (tea.Cmd, error)

func (*Model) GetFilePreviewCmd

func (m *Model) GetFilePreviewCmd(forcePreviewRender bool) tea.Cmd

func (*Model) GetFilePreviewRender

func (m *Model) GetFilePreviewRender() string

func (*Model) GetFocusedFilePanel

func (m *Model) GetFocusedFilePanel() *filepanel.Model

func (*Model) MoveFocusedPanelBy

func (m *Model) MoveFocusedPanelBy(delta int)

func (*Model) NextFilePanel

func (m *Model) NextFilePanel()

func (*Model) PanelCount

func (m *Model) PanelCount() int

func (*Model) PreviousFilePanel

func (m *Model) PreviousFilePanel()

func (*Model) Render

func (m *Model) Render() string

func (*Model) SetDimensions

func (m *Model) SetDimensions(width int, height int) tea.Cmd

Use SetDimensions if you want to update both it will prevent duplicate file preview commands and hence, is efficient

func (*Model) SetHeight

func (m *Model) SetHeight(height int) tea.Cmd

func (*Model) SetWidth

func (m *Model) SetWidth(width int) tea.Cmd

func (*Model) ToggleFilePreviewPanel

func (m *Model) ToggleFilePreviewPanel() tea.Cmd

func (*Model) UpdatePreviewPanel

func (m *Model) UpdatePreviewPanel(msg preview.UpdateMsg)

Jump to

Keyboard shortcuts

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