diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2022-02-23 17:59:06 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2022-02-23 18:03:35 +0000 |
| commit | cb43c581508d8d597a54dd963c3a1989c57d585e (patch) | |
| tree | 1db5d06a82af74b91114c3d686533d2b8dda2582 /debug.h | |
| parent | Merge branch 'custom-input-escapes' (diff) | |
commands: refactor scrollback up/down
When moving the viewport in the scrollback (i.e. “scrolling”), we need
to ensure the viewport is not moved past the beginning, or end, of the
scrollback.
This was previously accomplish by first limiting the number of lines
to scroll to the number of visible rows (i.e the viewport _size_), and
by adjusting the viewport after moving it, to ensure it doesn’t point
into an uninitialized scrollback area etc.
I.e. the implementation was _reactive_.
This patch rewrites the logic to be _proactive_; we now calculate
_where_ the beginning (or end) of the scrollback is, and then how many
lines there is from there, to the viewport. This is our _maximum_
number of lines to scroll.
When done correctly (which I hope this patch does), this allows us to
remove _all_ checks after moving the viewport - we already _know_ it’s
correct, and valid.
As a bonus, we can remove the old limit, where scrolling was only
allowed to be at most a single page.
Diffstat (limited to 'debug.h')
0 files changed, 0 insertions, 0 deletions
