diff options
author | Javier Lopez <graulopezjavier@gmail.com> | 2022-06-08 19:46:57 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-08 17:46:57 -0700 |
commit | 916d848049979e7b3974fbf4b6fdf2cf58ae98c3 (patch) | |
tree | d2a7df62c939f30a6f206f279cc01a74e5e37d2a /src/nvim/option.c | |
parent | 10291bb8541e461cd3b089bb05c1e3b3946955c5 (diff) | |
download | rneovim-916d848049979e7b3974fbf4b6fdf2cf58ae98c3.tar.gz rneovim-916d848049979e7b3974fbf4b6fdf2cf58ae98c3.tar.bz2 rneovim-916d848049979e7b3974fbf4b6fdf2cf58ae98c3.zip |
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
Diffstat (limited to 'src/nvim/option.c')
-rw-r--r-- | src/nvim/option.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c index 5565e6f167..a15c6f4854 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -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; |