Documentation
¶
Index ¶
- Variables
- func ErrorBox(err error, width int) string
- func ListThemes() []string
- func RenderBarChart(additions, deletions, maxChanges, width int) string
- func RenderCommitHistory(history stats.CommitHistory, width int) string
- func RenderFileList(files []git.FileStat, selectedIdx int) string
- func RenderFileStat(file git.FileStat, maxChanges, barWidth int) string
- func RenderFooter(showLineNumbers bool, fullContext bool, focusOnFileList bool, searchMode bool, ...) string
- func RenderSide(rows []parser.DiffRow, side Side, showLineNumbers bool, ...) string
- func RenderStatsFooter(compareMode string, termWidth int) string
- func RenderStatsSection(title string, s stats.Stats, width int) string
- func RenderStatsView(branchStats *stats.BranchStats, width, height int) string
- func SetTheme(name string)
- func ValidateTheme(name string) bool
- type SearchMatch
- type Side
- type Theme
Constants ¶
This section is empty.
Variables ¶
var ( TitleStyle lipgloss.Style BorderStyle lipgloss.Style AddStyle lipgloss.Style DelStyle lipgloss.Style HeaderSeparatorStyle lipgloss.Style HeaderLineStyle lipgloss.Style ErrorBoxStyle lipgloss.Style // File list sidebar styles FileListStyle lipgloss.Style FileListStyleFocused lipgloss.Style FileListItemStyle lipgloss.Style SelectedFileStyle lipgloss.Style // Stats styles AdditionsStyle lipgloss.Style DeletionsStyle lipgloss.Style DeltaStyle lipgloss.Style StatusModifiedStyle lipgloss.Style StatusAddedStyle lipgloss.Style StatusDeletedStyle lipgloss.Style StatusUntrackedStyle lipgloss.Style // Border styles for focused/unfocused panes BorderStyleFocused lipgloss.Style BorderStyleUnfocused lipgloss.Style // Search match highlighting styles SearchMatchStyle lipgloss.Style SearchCurrentMatchStyle lipgloss.Style SearchInputStyle lipgloss.Style // Branch selector styles BranchSelectorBoxStyle lipgloss.Style BranchSelectorTitleStyle lipgloss.Style BranchSelectorInputStyle lipgloss.Style CurrentBranchStyle lipgloss.Style SelectedBranchStyle lipgloss.Style BranchListItemStyle lipgloss.Style BranchCountStyle lipgloss.Style )
All styles use the current theme colors
Functions ¶
func RenderBarChart ¶ added in v0.6.0
RenderBarChart creates a visual bar chart using block characters.
func RenderCommitHistory ¶ added in v0.6.0
func RenderCommitHistory(history stats.CommitHistory, width int) string
RenderCommitHistory renders the list of recent commits.
func RenderFileList ¶
RenderFileList generates the sidebar content showing all modified files.
func RenderFileStat ¶ added in v0.6.0
RenderFileStat renders a single file with status icon, stats, and bar chart.
func RenderFooter ¶
func RenderFooter(showLineNumbers bool, fullContext bool, focusOnFileList bool, searchMode bool, showUntracked bool, searchInfo string, branchCompareMode bool, termWidth int) string
RenderFooter renders the footer with keyboard shortcuts and feature states. searchInfo format: "Match X of Y" or empty string if no search
func RenderSide ¶
func RenderSide(rows []parser.DiffRow, side Side, showLineNumbers bool, searchMatches ...SearchMatch) string
RenderSide turns structured diff rows into a string suitable for a viewport. If searchMatches is provided, it highlights the matches in the output.
func RenderStatsFooter ¶ added in v0.6.0
RenderStatsFooter renders footer with keyboard hints for stats view.
func RenderStatsSection ¶ added in v0.6.0
RenderStatsSection renders a single stats section with file list and summary.
func RenderStatsView ¶ added in v0.6.0
func RenderStatsView(branchStats *stats.BranchStats, width, height int) string
RenderStatsView renders the full stats screen for branch comparison.
func ValidateTheme ¶
ValidateTheme checks if a theme name is valid
Types ¶
type SearchMatch ¶
SearchMatch represents a search match for highlighting We define it here to avoid circular imports
type Theme ¶
type Theme struct {
Name string
// Diff colors
AdditionBg string
AdditionFg string
DeletionBg string
DeletionFg string
ContextFg string
HeaderFg string
// UI colors
BorderColor string
FocusedBorderColor string
TitleFg string
// File list colors
ModifiedFg string
AddedFg string
DeletedFg string
// General
Background string
Foreground string
}
Theme defines colors for all UI elements
func HighContrastTheme ¶
func HighContrastTheme() Theme
HighContrastTheme - Maximum contrast for accessibility