salmon = lipgloss.AdaptiveColor{Light: "#d20f39", Dark: "#f38ba8"}
base = lipgloss.AdaptiveColor{Light: "#eff1f5", Dark: "#1e1e2e"}
surface = lipgloss.AdaptiveColor{Light: "#ccd0da", Dark: "#313244"}
textStyle = lipgloss.NewStyle().Foreground(textC)
dimStyle = lipgloss.NewStyle().Foreground(overlay)
faintStyle = lipgloss.NewStyle().Foreground(overlay).Faint(true)
mintStyle = lipgloss.NewStyle().Foreground(mint)
yellowStyle = lipgloss.NewStyle().Foreground(yellow)
salmonStyle = lipgloss.NewStyle().Foreground(salmon)
mauveStyle = lipgloss.NewStyle().Foreground(mauve)
selfPill = lipgloss.NewStyle().Background(lavender).Foreground(base).Padding(0, 1)
pickStyle = lipgloss.NewStyle().Background(surface)
borderStyle = lipgloss.NewStyle().Foreground(overlay)
textStyle = lipgloss.NewStyle().Foreground(textC)
dimStyle = lipgloss.NewStyle().Foreground(overlay)
faintStyle = lipgloss.NewStyle().Foreground(overlay).Faint(true)
mintStyle = lipgloss.NewStyle().Foreground(mint)
yellowStyle = lipgloss.NewStyle().Foreground(yellow)
salmonStyle = lipgloss.NewStyle().Foreground(salmon)
mauveStyle = lipgloss.NewStyle().Foreground(mauve)
lavenderStyle = lipgloss.NewStyle().Foreground(lavender)
selfPill = lipgloss.NewStyle().Background(lavender).Foreground(base).Padding(0, 1)
pickStyle = lipgloss.NewStyle().Background(surface)
borderStyle = lipgloss.NewStyle().Foreground(overlay)
)
// maxUIWidth keeps right-aligned columns from drifting past ~76 columns on
// very wide terminals
233 unmodified lines
Expand all
rest := s.Canonical() + " " + s.Command + " " + s.Cwd
if cursor == m.cursor {
b.WriteString(pickStyle.Render(padTo("› "+rest, w-1-utf8.RuneCountInString(age))+" "+age) + "\n")
} else {
left2 := " " + mauveStyle.Render(s.Canonical()) + " " + s.Command + " " + yellowStyle.Render(s.Cwd)
left2 := " " + mauveStyle.Render(s.Canonical()) + " " + lavenderStyle.Render(s.Command) + " " + yellowStyle.Render(s.Cwd)
fill2 := max(0, w-utf8.RuneCountInString(age)-lipgloss.Width(left2))
b.WriteString(left2 + strings.Repeat(" ", fill2) + age + "\n")
}
cursor++
if cursor == m.cursor {
// one style for the whole highlighted row, no nested resets
b.WriteString(pickStyle.Render(padTo(" › "+rest, w-1-utf8.RuneCountInString(age))+" "+age) + "\n")
} else {
left2 := " " + mauveStyle.Render(s.ID) + " " + s.Command + " " + yellowStyle.Render(s.Cwd)
left2 := " " + mauveStyle.Render(s.ID) + " " + lavenderStyle.Render(s.Command) + " " + yellowStyle.Render(s.Cwd)
fill2 := max(0, w-utf8.RuneCountInString(age)-lipgloss.Width(left2))
b.WriteString(left2 + strings.Repeat(" ", fill2) + age + "\n")
}
cursor++