overlay = lipgloss.AdaptiveColor{Light: "#9ca0b0", Dark: "#6c7086"}
lavender = lipgloss.AdaptiveColor{Light: "#7287fd", Dark: "#b4befe"}
mauve = lipgloss.AdaptiveColor{Light: "#8839ef", Dark: "#cba6f7"}
mint = lipgloss.AdaptiveColor{Light: "#40a02b", Dark: "#a6e3a1"}
yellow = lipgloss.AdaptiveColor{Light: "#df8e1d", Dark: "#f9e2af"}
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)
238 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 + " " + textStyle.Render(s.Cwd)
left2 := " " + mauveStyle.Render(s.Canonical()) + " " + 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 + " " + textStyle.Render(s.Cwd)
left2 := " " + mauveStyle.Render(s.ID) + " " + 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++