fix(panes): scrollback page/halfpage up/down row count #4239
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.
Noticed that when performing
PageScrollUp
andPageScrollDown
repeatedly my position in the buffer was shifting by one row. This was caused by using.rows()
instead of.get_content_rows()
when performingPageUp
.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 inHalfPage
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 usingget_content_rows
which does that would make sense.