filelist

package
v0.0.0-...-6d55746 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DisplayItem

type DisplayItem struct {
	IsFolder     bool
	IsExpanded   bool
	FolderPath   string
	File         *git.ChangedFile
	Indent       int
	IsTypeHeader bool
	TypeHeader   string
}

DisplayItem represents an item in the display list

type FileSelectMsg

type FileSelectMsg struct {
	File *git.ChangedFile
}

FileSelectMsg is sent when a file is selected with Enter

type Model

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

Model represents the file list component

func New

func New() Model

New creates a new file list model

func (Model) Cursor

func (m Model) Cursor() int

Cursor returns the current cursor position

func (Model) Files

func (m Model) Files() []git.ChangedFile

Files returns all files

func (Model) Init

func (m Model) Init() tea.Cmd

Init implements tea.Model

func (Model) IsFocused

func (m Model) IsFocused() bool

IsFocused returns whether this component is focused

func (Model) IsSearching

func (m Model) IsSearching() bool

IsSearching returns whether search is active

func (Model) SelectedFile

func (m Model) SelectedFile() *git.ChangedFile

SelectedFile returns the currently selected file

func (*Model) SetCursor

func (m *Model) SetCursor(pos int)

SetCursor sets the cursor position

func (*Model) SetFiles

func (m *Model) SetFiles(files []git.ChangedFile)

SetFiles sets the list of files to display

func (*Model) SetFocused

func (m *Model) SetFocused(focused bool)

SetFocused sets whether this component is focused

func (*Model) SetSize

func (m *Model) SetSize(width, height int)

SetSize sets the dimensions of the file list

func (Model) Update

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

Update implements tea.Model

func (Model) View

func (m Model) View() string

View implements tea.Model

type TreeNode

type TreeNode struct {
	Name     string
	Path     string
	IsDir    bool
	File     *git.ChangedFile
	Children map[string]*TreeNode
}

TreeNode represents a node in the file tree

type ViewMode

type ViewMode int

ViewMode represents the current view mode

const (
	ViewFolder ViewMode = iota // Files in tree structure
	ViewType                   // Files grouped by change type
	ViewRaw                    // Flat list
)

Jump to

Keyboard shortcuts

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