From cacddc7bcb8af7c6692c3157de79a00906be67ef Mon Sep 17 00:00:00 2001 From: Anton Medvedev Date: Tue, 19 Sep 2023 21:42:08 +0200 Subject: [PATCH] Fix pgdown for small JSON files Fixes #265 --- main.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/main.go b/main.go index 024d069..0c24aae 100644 --- a/main.go +++ b/main.go @@ -311,6 +311,7 @@ func (m *model) handleKey(msg tea.KeyMsg) (tea.Model, tea.Cmd) { for i := 0; i < m.viewHeight(); i++ { m.down() } + m.scrollIntoView() case key.Matches(msg, keyMap.HalfPageUp): m.cursor = 0 @@ -323,6 +324,7 @@ func (m *model) handleKey(msg tea.KeyMsg) (tea.Model, tea.Cmd) { for i := 0; i < m.viewHeight()/2; i++ { m.down() } + m.scrollIntoView() case key.Matches(msg, keyMap.GotoTop): m.head = m.top