-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Make buffer length equal rows + scrollback, make alt buffer always 0 scrollback #855
Conversation
This is needed so that resize is still performant. Now the list size is only rebuild (O(n)) when it goes beyond 40 entries of the initial max length. The List is also rebuilt when the size shrinks below 120 of the actual backing max length (init_max_length + 40 - 120).
Unfortunately this removed the padding idea from CircularList as it would only work when the list is not full.
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.
My main concern with this PR is that a buffer
becomes aware if it is the alt buffer or not.
Instead of doing this, I propose setting the length of each buffer explicitly via the BufferSet
which is aware of both the normal and the alt buffer, and essentially manages them.
@parisk I'm not sure that's better though, right now the "alt buffer scrollback is 0" logic is contained in a single place (as well as the comment explaining it). If we had If preferable we could change the |
Ping @parisk |
Couldn't we just pass it only in the constructor and have Renaming |
@parisk but they change and the values are needed every time these functions are called. We would either have to pipe through the scrollback (or total height) every time from BufferSet or just have Buffer manage it itself. |
Fixes #847
Fixes #802