fix: account for status bar height when sizing viewport
This commit is contained in:
parent
1c9d180d35
commit
37fc5ee968
4
main.go
4
main.go
|
|
@ -632,10 +632,10 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
|||
|
||||
switch msg := msg.(type) {
|
||||
case tea.WindowSizeMsg:
|
||||
// Reserve 1 row for the status bar, 5 for the textarea.
|
||||
m.viewport.Width = msg.Width
|
||||
m.viewport.Height = msg.Height - 5 - 1
|
||||
m.textarea.SetWidth(msg.Width)
|
||||
barHeight := lipgloss.Height(m.renderStatusBar())
|
||||
m.viewport.Height = msg.Height - m.textarea.Height() - barHeight
|
||||
m.refreshView()
|
||||
m.ready = true
|
||||
|
||||
|
|
|
|||
Reference in New Issue