jesseduffield / lazygit

simple terminal UI for git commands
MIT License
52.65k stars 1.84k forks source link

Don't show scrollbars when the entire content is visible #3772

Closed jakubkaczor closed 3 months ago

jakubkaczor commented 3 months ago

Is your feature request related to a problem? Please describe. Scrollbar indicates to me there is something to scroll, especially if it doesn't fill the entire space. Oftentimes, there is nothing to scroll.

Describe the solution you'd like I would like the scrollbars to show only if there is something to scroll.

Additional context Add any other context or screenshots about the feature request here. image

stefanhaller commented 3 months ago

Scroll-bars do disappear when there's really nothing to scroll, this works correctly already. In your case, there is something to scroll (try it by using the mouse wheel or pressing ctrl-d: it will scroll down a few lines).

This is caused by the config option gui.scrollPastBottom, which is true by default. This is causing lazygit to make the text a little longer than it actually is. I personally hate this option and have turned it off (in VS Code as well, which has a similar option).

@jesseduffield Would you consider changing the default of this config to false?

jesseduffield commented 3 months ago

I personally love the option because it allows me to view each line at of code at whichever position on the screen is most comfortable for me to read (typically the center). I don't see the need to change the default, but am open to doing so if more people complain

stefanhaller commented 3 months ago

I see; I wasn't aware that that's the reason for the option to exist. I thought it's so that you don't lose track of where you are when you scroll by whole pages. Anyway, happy to keep the default the way it is if you prefer it.

The thing is that I don't think people will complain about it. I suspect most people aren't conscious about the option, or whether it's ideal for them. I have a coworker with whom I pair a lot, and whenever he wants to see the last page of a diff, he will scroll down quickly, overshoot a lot, and carefully scroll up again until he sees enough of that last page. It's painful to watch every time; it would be so much easier if he could just fling downwards until he hits the end. I tried to talk to him about it and persuade him to turn that option off, but he didn't see a problem.

jakubkaczor commented 3 months ago

Thank you, stefanhaller. I read the configuration and gui.scrollPastBottom didn't seem relevant, but it actually does what I need and solves the issue.

Scroll-bars do disappear when there's really nothing to scroll, this works correctly already.

Right, it disappears with the option turned off. Perhaps the title of this issue is more precise than a description. I meant not to show the scroll bar when the entire diff content or original file content is already visible.

If it comes to the defaults, I only want to note that the behavior with gui.scrollPastBottom = false is default in Firefox and likely in other web browsers, so it may be more expected for an average user.