Skip to content

Commit

Permalink
tui: list to occupy the whole screen on init
Browse files Browse the repository at this point in the history
  • Loading branch information
azimut committed Apr 28, 2023
1 parent 5592a32 commit 3323475
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/tui/tui.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func (m Model) Update(msg tea.Msg) (Model, tea.Cmd) {
switch msg := msg.(type) {
case tea.WindowSizeMsg:
if !m.IsReady {
m.Initialize(msg)
m.initialize(msg)
m.IsReady = true
} else {
if m.onLinkScreen {
Expand Down Expand Up @@ -179,7 +179,7 @@ func isScrolling(msg tea.KeyMsg) bool {
DefaultViewportKeyMap.PageDown)
}

func (m *Model) Initialize(msg tea.WindowSizeMsg) {
func (m *Model) initialize(msg tea.WindowSizeMsg) {
m.Viewport = viewport.Model{
Width: msg.Width,
Height: msg.Height - 1,
Expand All @@ -197,7 +197,7 @@ func (m *Model) Initialize(msg tea.WindowSizeMsg) {
getItems(m.RawContent),
itemDelegate{},
msg.Width,
msg.Height-1,
msg.Height,
)
m.list.KeyMap = DefaultListKeyMap
m.list.SetShowTitle(false)
Expand Down

0 comments on commit 3323475

Please sign in to comment.