Documentation
¶
Index ¶
- Constants
- Variables
- func Chart(width, height, radius int, totalValue float64, raw []RawChartSector) string
- func EntryIcon(e *structure.Entry) string
- func NewProgressBar(width int, full, empty rune) progress.Model
- func NewStatusBar(items []*BarItem, totalWidth int) string
- func Overlay(_ int, background, overlay string, row, col int) string
- func OverlayCenter(fullWidth, fullHeight int, background, overlay string) string
- func ReportError(err error, stackTrace []byte) string
- type BarItem
- type Column
- type CycleLangFilter
- type DirModel
- type EditorFinished
- type ErrorMsg
- type FilePreview
- type Mode
- type Navigation
- type OpenFileInEditor
- type RawChartSector
- type ScanFinished
- type SortKey
- type SortState
- type ViewModel
Constants ¶
const ( DefaultBorder = '\ue0b0' DefaultBarBGColor = "#353533" DynamicWidth = -1 )
const Version = "v1.0.0-tokei"
Variables ¶
var ( TableHeaderStyle = lipgloss.NewStyle(). Bold(true). BorderStyle(lipgloss.ThickBorder()). BorderForeground(lipgloss.Color("240")). BorderBottom(true) TopHeaderStyle = lipgloss.NewStyle(). Inherit(TableHeaderStyle). BorderTop(true). BorderStyle(lipgloss.NormalBorder()) SelectedRowStyle = lipgloss.NewStyle(). Foreground(lipgloss.Color("#262626")). Background(lipgloss.Color("#ebbd34")). Bold(false) )
Functions ¶
func Chart ¶
func Chart(width, height, radius int, totalValue float64, raw []RawChartSector) string
Chart generates an ASCII pie chart and its legend based on the provided data.
func NewProgressBar ¶
NewProgressBar creates a custom styled progress bar (currently unused)
func NewStatusBar ¶
NewStatusBar builds a status bar with the given items and total width
func OverlayCenter ¶
func ReportError ¶
ReportError formats an error with stack trace and instructions for reporting
Types ¶
type BarItem ¶
type BarItem struct {
// contains filtered or unexported fields
}
BarItem represents a status bar item width -1 means take all available width, shared equally with other -1 width items
func DefaultBarItem ¶
DefaultBarItem creates an item with default background color and width
func NewBarItem ¶
NewBarItem creates an item with specified properties
type CycleLangFilter ¶
type CycleLangFilter struct{}
type DirModel ¶
type DirModel struct {
// contains filtered or unexported fields
}
func NewDirModel ¶
func NewDirModel(nav *Navigation) *DirModel
NewDirModel creates and initializes a directory view model.
func (*DirModel) ExitSearchMode ¶
func (dm *DirModel) ExitSearchMode()
func (*DirModel) IsInPreviewMode ¶ added in v0.2.0
IsInPreviewMode returns true if currently showing file preview
func (*DirModel) ShowFilePreview ¶ added in v0.2.0
ShowFilePreview creates and shows a file preview
type EditorFinished ¶ added in v0.3.3
type EditorFinished struct {
Err error
}
EditorFinished represents a message that the editor has finished.
type ErrorMsg ¶ added in v0.3.3
type ErrorMsg struct {
Err error
}
ErrorMsg represents a message containing an error.
type FilePreview ¶ added in v0.2.0
type FilePreview struct {
// contains filtered or unexported fields
}
FilePreview represents the file preview component using viewport
func NewFilePreview ¶ added in v0.2.0
func NewFilePreview(filePath string, width, height int) *FilePreview
NewFilePreview creates a new file preview component
func (*FilePreview) GetViewportModel ¶ added in v0.2.0
func (fp *FilePreview) GetViewportModel() *viewport.Model
GetViewportModel returns the underlying viewport model for external control
func (*FilePreview) Init ¶ added in v0.2.0
func (fp *FilePreview) Init() tea.Cmd
Init initializes the file preview component
func (*FilePreview) View ¶ added in v0.2.0
func (fp *FilePreview) View() string
View renders the file preview
type Navigation ¶
type Navigation struct {
// contains filtered or unexported fields
}
Navigation handles traversal through the code statistics tree
func NewCodeNavigation ¶
func NewCodeNavigation(t *structure.Tree) *Navigation
func (*Navigation) AbsPathFromSelectedRow ¶
func (n *Navigation) AbsPathFromSelectedRow(selectedRow []string) string
AbsPathFromSelectedRow returns absolute path from selected row, using column 1's hidden path
func (*Navigation) Down ¶
func (n *Navigation) Down(name string, cursor int)
func (*Navigation) Entry ¶
func (n *Navigation) Entry() *structure.Entry
Entry returns the current directory
func (*Navigation) ParentTotalLines ¶
func (n *Navigation) ParentTotalLines(langFilter string) int64
ParentTotalLines returns the total lines of the parent directory for calculating child entry percentages. The langFilter parameter allows getting total lines based on the currently selected language.
func (*Navigation) Up ¶
func (n *Navigation) Up()
type OpenFileInEditor ¶ added in v0.3.3
type OpenFileInEditor struct {
Path string
}
OpenFileInEditor represents a message to open a file in the default editor.
type RawChartSector ¶
type RawChartSector struct {
Label string
Value float64 // Using float64 to accommodate code line counts
}
RawChartSector is the raw data input for building the chart.
type ScanFinished ¶
type ScanFinished struct{}
type ViewModel ¶
type ViewModel struct {
// contains filtered or unexported fields
}
func NewViewModel ¶
func NewViewModel(n *Navigation, dirModel *DirModel) *ViewModel