neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit 1e9143879d6b05bf7e4ed2a59d64d18418d2594f
parent 0c46ea7d38dcdadaf217c1d8fd9178744f9bcf1f
Author: zeertzjq <zeertzjq@outlook.com>
Date:   Wed, 11 Feb 2026 06:36:49 +0800

refactor(terminal.c): move screen callbacks together (#37808)

Misplaced term_sb_clear() when rebasing #21412.
Diffstat:
Msrc/nvim/terminal.c | 40++++++++++++++++++++--------------------
1 file changed, 20 insertions(+), 20 deletions(-)

diff --git a/src/nvim/terminal.c b/src/nvim/terminal.c @@ -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 {{{