-
Notifications
You must be signed in to change notification settings - Fork 16
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
sheet: Fix scrolling up when a buffer refill is required #271
Conversation
@richiejp thank you! Is there a trivial test we can add, that should pass with this change in place (but fail when this change is not applied)? |
26d8c5e
to
8d31f4d
Compare
I added a test to scroll up from the bottom to the top (it skips a test number due to a conflict with my other PR). Thanks! |
@richiejp great, thank you. It looks like the test requires a file "expected/test-sheet-9.out" that needs to be committed to the repo. Could you add that and then confirm that the CI tests pass? |
Sorry that catches me out every time, I have added a .gitignore for that dir so that the .out files are not ignored there. |
c835a6f
to
a65cd3a
Compare
Also remove *.out from .gitignore for the expected directory so that the expected outputs don't have to be force added.
a65cd3a
to
6e567bf
Compare
I had to add quite a large delay to the test for it to pass in CI. Probably it's best to poll the output until it settles for 0.5 of a second instead of setting absolute delays. |
sleep 0.5 && \ | ||
tmux send-keys -t $@ "G" && \ | ||
tmux send-keys -t $@ -N 4096 "k" && \ | ||
sleep 2 && \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may adjust -y
(height) above to reduce the number of repeat count -N
and delay here.
Change tmux-256color to TMUX_TERM to pass all OS tests
There is a bug which happens when scrolling up requires a buffer refill. Essentially it appears to be off-by-one when deciding if the desired row is outside the buffers lower boundary. It can be reproduced by pressing G then C-u or k repeatedly until it gets stuck.
Adding the header_span value to the lower boundary appears to resolve the issue, but I'm not completely sure this is the correct solution.
There's another bug where scrolling down one page from the top then trying to scroll up one page does not work unless the arrow keys are used to go a bit further down first. It doesn't appear to be related to this one.