mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-11-27 22:38:09 +02:00
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.
This commit is contained in:
@@ -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
|
// 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
|
// scrollbar go to its minimum height, so that the scrollbar thumb doesn't
|
||||||
// change size as you scroll down.
|
// change size as you scroll down.
|
||||||
minScrollbarHeight := 2
|
minScrollbarHeight := 1
|
||||||
linesToReadForAccurateScrollbar := height*(height-1)/minScrollbarHeight + oy
|
linesToReadForAccurateScrollbar := height*(height-1)/minScrollbarHeight + oy
|
||||||
|
|
||||||
// However, cap it at some arbitrary max limit, so that we don't get
|
// However, cap it at some arbitrary max limit, so that we don't get
|
||||||
|
|||||||
Reference in New Issue
Block a user