@@ -124,7 +124,7 @@ func (m Model) View() string {
124124}
125125
126126func viewSmall (m Model , l layout ) string {
127- content := renderHeader (l .innerWidth , m .keys ) +
127+ content := renderHeader (l .innerWidth , m .keys , len ( m . filtered ), len ( m . projects ) ) +
128128 renderInput (m .query ) +
129129 renderList (l , m .filtered , m .cursor , 0 ) +
130130 renderFooter (l .innerWidth , m .keys )
@@ -136,7 +136,7 @@ func viewBoxed(m Model, l layout) string {
136136 fixedHeight := max (len (m .projects ), minFixedListHeight )
137137 fixedHeight = min (fixedHeight , maxBoxedListHeight )
138138 fixedHeight = min (fixedHeight , l .maxListHeight )
139- content := renderHeader (l .innerWidth , m .keys ) +
139+ content := renderHeader (l .innerWidth , m .keys , len ( m . filtered ), len ( m . projects ) ) +
140140 renderInput (m .query ) +
141141 renderList (l , m .filtered , m .cursor , fixedHeight ) +
142142 renderFooter (l .innerWidth , m .keys )
@@ -167,12 +167,13 @@ func calculateLayout(width, height, maxLineWidth int) layout {
167167 }
168168}
169169
170- func renderHeader (innerWidth int , keys KeyMap ) string {
170+ func renderHeader (innerWidth int , keys KeyMap , filteredCount , totalCount int ) string {
171171 title := titleStyle .Render ("Projects" )
172+ counter := pathStyle .Render (fmt .Sprintf (" (%d/%d)" , filteredCount , totalCount ))
172173 escHint := keymapKeyStyle .Render (keys .Cancel .Help ().Key )
173- padding := max (innerWidth - lipgloss .Width (title )- lipgloss .Width (escHint ), 1 )
174+ padding := max (innerWidth - lipgloss .Width (title )- lipgloss .Width (counter ) - lipgloss . Width ( escHint ), 1 )
174175
175- return title + strings .Repeat (" " , padding ) + escHint + "\n \n "
176+ return title + counter + strings .Repeat (" " , padding ) + escHint + "\n \n "
176177}
177178
178179func renderInput (query string ) string {
0 commit comments