make settings list fit screen size, use batch message to ensure all callbacks used

This commit is contained in:
2023-03-01 18:20:56 -08:00
parent fdb5aeae32
commit 1b47179339
3 changed files with 22 additions and 6 deletions

View File

@@ -53,6 +53,10 @@ var settingsKey = key.NewBinding(
)
func (m Settings) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
if msg, ok := msg.(tea.WindowSizeMsg); ok {
m.AuthorList.SetHeight(msg.Height - 8)
m.RepoList.SetHeight(msg.Height - 8)
}
switch m.cursor {
case authors:
var cmd tea.Cmd