Skip to content

fix(panes): scrollback page/halfpage up/down row count #4239

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

DawidPietrykowski
Copy link
Contributor

Noticed that when performing PageScrollUp and PageScrollDown repeatedly my position in the buffer was shifting by one row. This was caused by using .rows() instead of .get_content_rows() when performing PageUp.

I believe that .get_content_rows() should be used for all commands related to scrolling (PageDown was already using that) because according to this comment it excludes the frame and the frame shouldn't be affecting the jump length. Following that I also added it in HalfPage commands.

I think the original code was supposed to account for the frame by subtracting one (active_pane.rows().max(1).saturating_sub(1)) but actually 2 rows should be subtracted so using get_content_rows which does that would make sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant