mirror of
https://github.com/neovim/neovim.git
synced 2026-08-30 19:11:52 +00:00
refactor(terminal.c): move screen callbacks together (#37808)
Misplaced term_sb_clear() when rebasing #21412.
This commit is contained in:
@@ -1647,6 +1647,26 @@ static int term_sb_pop(int cols, VTermScreenCell *cells, void *data)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int term_sb_clear(void *data)
|
||||
{
|
||||
Terminal *term = data;
|
||||
|
||||
if (term->in_altscreen || !term->sb_size || !term->sb_current) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < term->sb_current; i++) {
|
||||
xfree(term->sb_buffer[i]);
|
||||
}
|
||||
|
||||
term->sb_deleted += term->sb_current;
|
||||
term->sb_current = 0;
|
||||
term->sb_pending = 0;
|
||||
invalidate_terminal(term, -1, -1);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void term_clipboard_set(void **argv)
|
||||
{
|
||||
VTermSelectionMask mask = (VTermSelectionMask)(long)argv[0];
|
||||
@@ -1695,26 +1715,6 @@ static int term_selection_set(VTermSelectionMask mask, VTermStringFragment frag,
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int term_sb_clear(void *data)
|
||||
{
|
||||
Terminal *term = data;
|
||||
|
||||
if (term->in_altscreen || !term->sb_size || !term->sb_current) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < term->sb_current; i++) {
|
||||
xfree(term->sb_buffer[i]);
|
||||
}
|
||||
|
||||
term->sb_deleted += term->sb_current;
|
||||
term->sb_current = 0;
|
||||
term->sb_pending = 0;
|
||||
invalidate_terminal(term, -1, -1);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
// }}}
|
||||
// input handling {{{
|
||||
|
||||
|
||||
Reference in New Issue
Block a user