diff options
author | Stefan Haller <stefan@haller-berlin.de> | 2024-01-30 08:39:05 +0100 |
---|---|---|
committer | Stefan Haller <stefan@haller-berlin.de> | 2024-02-16 13:48:27 +0100 |
commit | 2b9cb3a640fda4ae5a3df5f14fc971bd8881307e (patch) | |
tree | 8e5b6fe95cfd5a71e82b0cc4e03d0534a792b159 /pkg/gui/view_helpers.go | |
parent | 1081c45397d9bf6741fc5519ad1e3d736960e40a (diff) |
Fix number of lines to read from a task initially for the right scroll bar size
After #3283 we need to read more lines initially so that the scrollbar goes to
its minimal height of 1 for long diffs. Without this, it would start with a
height of 2 and then become smaller after you scroll down half the window
height.
Diffstat (limited to 'pkg/gui/view_helpers.go')
-rw-r--r-- | pkg/gui/view_helpers.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pkg/gui/view_helpers.go b/pkg/gui/view_helpers.go index 58c973712..22126cc33 100644 --- a/pkg/gui/view_helpers.go +++ b/pkg/gui/view_helpers.go @@ -32,7 +32,7 @@ func (gui *Gui) linesToReadFromCmdTask(v *gocui.View) tasks.LinesToRead { // We want to read as many lines initially as necessary to let the // scrollbar go to its minimum height, so that the scrollbar thumb doesn't // change size as you scroll down. - minScrollbarHeight := 2 + minScrollbarHeight := 1 linesToReadForAccurateScrollbar := height*(height-1)/minScrollbarHeight + oy // However, cap it at some arbitrary max limit, so that we don't get |