diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2020-10-01 21:40:20 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2020-10-02 08:09:42 +1000 |
commit | 9125e3c0c6f9c2f83ba74f33b5899054b8641218 (patch) | |
tree | 613b6dc8a8e9af79a5500b6a66e62d38771a8e86 | |
parent | 86dd9d87dd046e09580f0f0caad109c97aa70546 (diff) |
stop refreshing item when at end of list
-rw-r--r-- | pkg/gui/list_context.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/pkg/gui/list_context.go b/pkg/gui/list_context.go index c360b2f2a..0edd80873 100644 --- a/pkg/gui/list_context.go +++ b/pkg/gui/list_context.go @@ -161,6 +161,11 @@ func (lc *ListContext) handleLineChange(change int) error { return err } + selectedLineIdx := lc.GetPanelState().GetSelectedLineIdx() + if (change < 0 && selectedLineIdx == 0) || (change > 0 && selectedLineIdx == lc.GetItemsLength()-1) { + return nil + } + lc.Gui.changeSelectedLine(lc.GetPanelState(), lc.GetItemsLength(), change) view.FocusPoint(0, lc.GetPanelState().GetSelectedLineIdx()) |