aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/terminal.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2022-10-09 08:21:52 -0400
committerGitHub <noreply@github.com>2022-10-09 05:21:52 -0700
commit09dffb9db7d16496e55e86f78ab60241533d86f6 (patch)
treeb41dda1a0c3f127ea5ab4a0e05516eda89341132 /src/nvim/terminal.c
parentde7be43acc9459e83e4fd5dcb390b5f2d2945c70 (diff)
downloadrneovim-09dffb9db7d16496e55e86f78ab60241533d86f6.tar.gz
rneovim-09dffb9db7d16496e55e86f78ab60241533d86f6.tar.bz2
rneovim-09dffb9db7d16496e55e86f78ab60241533d86f6.zip
docs: various #12823
- increase python line-length limit from 88 => 100. - gen_help_html: fix bug in "tag" case (tbl_count => tbl_contains) ref #15632 fix #18215 fix #18479 fix #20527 fix #20532 Co-authored-by: Ben Weedon <ben@weedon.email>
Diffstat (limited to 'src/nvim/terminal.c')
-rw-r--r--src/nvim/terminal.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/nvim/terminal.c b/src/nvim/terminal.c
index e54a1c8334..50574b292d 100644
--- a/src/nvim/terminal.c
+++ b/src/nvim/terminal.c
@@ -111,9 +111,9 @@ struct terminal {
// - receive data from libvterm as a result of key presses.
char textbuf[0x1fff];
- ScrollbackLine **sb_buffer; // Scrollback buffer storage for libvterm
- size_t sb_current; // number of rows pushed to sb_buffer
- size_t sb_size; // sb_buffer size
+ ScrollbackLine **sb_buffer; // Scrollback storage.
+ size_t sb_current; // Lines stored in sb_buffer.
+ size_t sb_size; // Capacity of sb_buffer.
// "virtual index" that points to the first sb_buffer row that we need to
// push to the terminal buffer when refreshing the scrollback. When negative,
// it actually points to entries that are no longer in sb_buffer (because the
@@ -154,7 +154,7 @@ static VTermScreenCallbacks vterm_screen_callbacks = {
.movecursor = term_movecursor,
.settermprop = term_settermprop,
.bell = term_bell,
- .sb_pushline = term_sb_push,
+ .sb_pushline = term_sb_push, // Called before a line goes offscreen.
.sb_popline = term_sb_pop,
};
@@ -952,7 +952,10 @@ static int term_bell(void *data)
return 1;
}
-// Scrollback push handler (from pangoterm).
+/// Scrollback push handler: called just before a line goes offscreen (and libvterm will forget it),
+/// giving us a chance to store it.
+///
+/// Code adapted from pangoterm.
static int term_sb_push(int cols, const VTermScreenCell *cells, void *data)
{
Terminal *term = data;