mirror of
https://github.com/zoriya/bubbles.git
synced 2026-08-16 01:43:21 +00:00
fix(filepicker): height calculations
This commit is contained in:
@@ -360,7 +360,7 @@ func (m Model) Update(msg tea.Msg) (Model, tea.Cmd) {
|
|||||||
// View returns the view of the file picker.
|
// View returns the view of the file picker.
|
||||||
func (m Model) View() string {
|
func (m Model) View() string {
|
||||||
if len(m.files) == 0 {
|
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
|
var s strings.Builder
|
||||||
|
|
||||||
@@ -415,6 +415,10 @@ func (m Model) View() string {
|
|||||||
s.WriteRune('\n')
|
s.WriteRune('\n')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for i := lipgloss.Height(s.String()); i <= m.Height; i++ {
|
||||||
|
s.WriteRune('\n')
|
||||||
|
}
|
||||||
|
|
||||||
return s.String()
|
return s.String()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user