diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2021-04-02 19:49:23 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2021-04-06 19:34:32 +1000 |
commit | d44ff447bd90e0ac5596ead1576ac832d01cda6c (patch) | |
tree | 99fc943d1fb7bced49f4d472a1a212b3a8089fd2 /pkg/gui/global_handlers.go | |
parent | 798d3e2d54e828f25ed4aadcefff11593fa23e10 (diff) |
fix panic
Diffstat (limited to 'pkg/gui/global_handlers.go')
-rw-r--r-- | pkg/gui/global_handlers.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/pkg/gui/global_handlers.go b/pkg/gui/global_handlers.go index bcaff5871..b32981f0c 100644 --- a/pkg/gui/global_handlers.go +++ b/pkg/gui/global_handlers.go @@ -94,8 +94,10 @@ func (gui *Gui) scrollDownView(viewName string) error { if scrollableLines-margin < scrollHeight { scrollHeight = scrollableLines - margin } - if err := mainView.SetOrigin(ox, oy+scrollHeight); err != nil { - return err + if oy+scrollHeight >= 0 { + if err := mainView.SetOrigin(ox, oy+scrollHeight); err != nil { + return err + } } } if manager, ok := gui.viewBufferManagerMap[viewName]; ok { |