282 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 + " " + dimStyle.Render(s.Cwd)
left2 := " " + mauveStyle.Render(s.Canonical()) + " " + s.Command + " " + textStyle.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 + " " + dimStyle.Render(s.Cwd)
left2 := " " + mauveStyle.Render(s.ID) + " " + s.Command + " " + textStyle.Render(s.Cwd)
fill2 := max(0, w-utf8.RuneCountInString(age)-lipgloss.Width(left2))
b.WriteString(left2 + strings.Repeat(" ", fill2) + age + "\n")
}
cursor++