fix: size of list

This commit is contained in:
2025-06-01 13:45:22 +01:00
parent d61677f2b2
commit 374f4f3034

View File

@ -162,14 +162,14 @@ func initialModel() model {
listItems[i] = item{title: postInfo.Title, desc: postInfo.Date.String(), index: i}
}
list := list.New(listItems, list.NewDefaultDelegate(), 0, 0)
list.Title = "Blog Posts"
w, h, err := term.GetSize(os.Stdout.Fd())
if err != nil {
panic(err)
}
list := list.New(listItems, list.NewDefaultDelegate(), w, h)
list.Title = "Blog Posts"
// -1 to allow for the initial height of the help model
vp := getViewPort(w, h-1)