lazygit icon indicating copy to clipboard operation
lazygit copied to clipboard

Scroll partial pages

Open saep opened this issue 3 years ago • 3 comments

  • PR Description

This PR allows one to configure scrolling partial pages.

I have changed the gui.scrollHeight configuration option to a float64. If it is defined in the range (-1, 1), then scrolling with pgup/pgdn (and the alternate keys) advances the page by that portion of the page. E.g. if you configure 0.5, then half a page is scrolled.

I think that this implementation is kind of a hack, but no configuration will be broken by this. I'm happy to implement this in a different way. This is the first time I programmed anything in go.

Fixes #2032 Fixes #1707

  • Please check if the PR fulfills these requirements
  • [x] Cheatsheets are up-to-date (run go run scripts/cheatsheet/main.go generate) I haven't added a keybinding.

  • [x] Code has been formatted (see here)

  • [x] Tests have been added/updated (see here for the integration test guide)

  • [x] Text is internationalised (see here) No text was added.

  • [x] Docs (specifically docs/Config.md) have been updated if necessary

  • [x] You've read through your own file changes for silly mistakes etc

saep avatar Oct 18 '22 19:10 saep

It does seem hackish, here's an alternative which isn't configurable, but it doesn't use floating points.

Make of it what you will :)

mark2185 avatar Oct 19 '22 07:10 mark2185

I agree that using the one field is a bit of a hack. Is that linked commit in master @mark2185 ?

jesseduffield avatar Oct 19 '22 17:10 jesseduffield

Is that linked commit in master @mark2185 ?

Nope, it was a draft for a draft PR that never actually got created.

mark2185 avatar Oct 19 '22 18:10 mark2185