@@ -1,6 +1,7 @@
1package dialog
1package dialog
@@ -71,35 +72,23 @@ func renderItem(t *styles.Styles, title string, updatedAt int64, focused bool, w
71 style = t.Dialog.SelectedItem
72 style = t.Dialog.SelectedItem
74− width -= style.GetHorizontalFrameSize()
76 var age string
75 var age string
77 if updatedAt > 0 {
78 if updatedAt > 0 {
78− age = humanize.Time(time.Unix(updatedAt, 0))
79+ age = fmt.Sprintf(" %s ", humanize.Time(time.Unix(updatedAt, 0)))
79 if focused {
80 if focused {
80 age = t.Base.Render(age)
81 age = t.Base.Render(age)
82 age = t.Subtle.Render(age)
83 age = t.Subtle.Render(age)
92 ageLen = lipgloss.Width(age)
86 ageLen = lipgloss.Width(age)
96− title = ansi.Truncate(title, max(0, lineWidth), "…")
89+ title = ansi.Truncate(title, max(0, lineWidth), "")
97 titleLen := lipgloss.Width(title)
90 titleLen := lipgloss.Width(title)
98−
91+ gap := strings.Repeat(" ", max(0, lineWidth-titleLen-ageLen))
100− right = lipgloss.NewStyle().AlignHorizontal(lipgloss.Right).Width(width - titleLen).Render(age)
103 content := title
92 content := title
104 if matches := len(m.MatchedIndexes); matches > 0 {
93 if matches := len(m.MatchedIndexes); matches > 0 {
105 var lastPos int
94 var lastPos int
@@ -129,7 +118,7 @@ func renderItem(t *styles.Styles, title string, updatedAt int64, focused bool, w
129 content = strings.Join(parts, "")
118 content = strings.Join(parts, "")
132− content = style.Render(content + right)
121+ content = style.Render(content + gap + age)
133 cache[width] = content
122 cache[width] = content
134 return content
123 return content