scroll keybindings: top, bottom, page up, page down, page fractional #261
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #259
Related #227
This introduces a number of new keybindings, with default bindings on Mac and Linux:
scroll_to_top
scrolls to the top of the viewportscroll_to_bottom
scrolls to the bottom of the viewportscroll_page_up
andscroll_page_down
scroll by one page (number of visible rows) up or down, respectivelyscroll_page_fractional
takes a floating point argument and scrolls byvisible_rows * fraction
, i.e.1
is equal toscroll_page_down
but0.5
would let you scroll a half page down.Default keybindings on Mac:
cmd+home=scroll_to_top
cmd+end=scroll_to_bottom
cmd+page_up=scroll_page_up
cmd+page_down=scroll_page_down
Default keybindings on Linux:
shift+home=scroll_to_top
shift+end=scroll_to_bottom
shift+page_up=scroll_page_up
shift+page_down=scroll_page_down
Example customizing
scroll_page_fractional
(default unbound):Demo:
CleanShot.2023-08-09.at.07.45.39.mp4
cc @andrewrk