aboutsummaryrefslogtreecommitdiff
path: root/foot-server@.socket
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2022-05-11 15:58:18 +0000
committerDaniel Eklöf <daniel@ekloef.se>2022-05-11 15:58:18 +0000
commitfc67bff9c0732f205b6850e4e6585355fc565482 (patch)
tree7f1202c986935b4057fa578de797204ab13cfba8 /foot-server@.socket
parentThemes: Add 'Monokai Pro' theme (diff)
terminal: move viewport when part of it is scrolled out
If the viewport is at the top of the scrollback, and a program is scrolling (e.g. by emitting newlines), the viewport needs to be moved. Otherwise, the top of the viewport will show the *bottom* of the scrollback (i.e. the newly emitted lines), and the bottom of the viewport shows the top of the scrollback. How do we detect if the viewport needs to be moved? We convert its absolute row number to a scrollback relative row. This number is also the maximum number of rows we can scroll without the viewport being scrolled out. In other words, if the number of rows to scroll is larger than the viewports scrollback relative row number, the viewport needs to moved. How much do we need to move it? The difference between the number of rows to scroll, and the viewports scrollback relative row number. Example: if the viewport is at the very top of the scrollback, its scrollback relative row number is 0. In this case, it needs to be moved the same number of rows as is being scrolled.
Diffstat (limited to 'foot-server@.socket')
0 files changed, 0 insertions, 0 deletions