mirror of
https://github.com/neovim/neovim.git
synced 2025-09-29 06:28:35 +00:00
fix(terminal): scrollback delete lines immediately #18832
* on_scrollback_option_changed renamed to adjust_scrollback. The function name did not correspond to what it was doing. It is called unconditionally in every refresh of the terminal unrelated if the scrollback option was changed. * new on_scrollback_option_changed function, which calls refresh_terminal, which then calls adjust_scrollback * terminal_check_size is not the appropriate function to call when the option is changed since it only conditionally adjusts the scrollback. Use the new on_scrollback_option_changed fixes #15477 fixes #11811
This commit is contained in:
@@ -4544,9 +4544,9 @@ static char *set_num_option(int opt_idx, char_u *varp, long value, char *errbuf,
|
||||
check_colorcolumn(wp);
|
||||
}
|
||||
} else if (pp == &curbuf->b_p_scbk || pp == &p_scbk) {
|
||||
if (curbuf->terminal) {
|
||||
// Force the scrollback to take effect.
|
||||
terminal_check_size(curbuf->terminal);
|
||||
if (curbuf->terminal && value < old_value) {
|
||||
// Force the scrollback to take immediate effect only when decreasing it.
|
||||
on_scrollback_option_changed(curbuf->terminal);
|
||||
}
|
||||
} else if (pp == &curwin->w_p_nuw) {
|
||||
curwin->w_nrwidth_line_count = 0;
|
||||
|
Reference in New Issue
Block a user