Skip to content

Commit

Permalink
fix(filepicker): height calculations
Browse files Browse the repository at this point in the history
  • Loading branch information
maaslalani committed Jan 29, 2024
1 parent d98bf9d commit 01d22a0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion filepicker/filepicker.go
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ func (m Model) Update(msg tea.Msg) (Model, tea.Cmd) {
// View returns the view of the file picker.
func (m Model) View() string {
if len(m.files) == 0 {
return m.Styles.EmptyDirectory.String()
return m.Styles.EmptyDirectory.Height(m.Height).MaxHeight(m.Height).String()
}
var s strings.Builder

Expand Down Expand Up @@ -415,6 +415,10 @@ func (m Model) View() string {
s.WriteRune('\n')
}

for i := lipgloss.Height(s.String()); i <= m.Height; i++ {
s.WriteRune('\n')
}

return s.String()
}

Expand Down

0 comments on commit 01d22a0

Please sign in to comment.