vim-patch:9.0.2145: wrong scrolling in insert mode with smoothscroll (#26375)

Problem:  Wrong scrolling in Insert mode with 'smoothscroll' at the
          bottom of the window.
Solution: Don't use set_topline() when 'smoothscroll' is set.

fixes: vim/vim#13612
closes: vim/vim#13613

5b4d1fcbf0
This commit is contained in:
zeertzjq
2023-12-04 06:42:47 +08:00
committed by GitHub
parent 988b472d90
commit 5651c1ff27
4 changed files with 42 additions and 2 deletions

View File

@@ -444,8 +444,11 @@ static int insert_check(VimState *state)
// is detected when the cursor column is smaller after inserting something.
// Don't do this when the topline changed already, it has already been
// adjusted (by insertchar() calling open_line())).
// Also don't do this when 'smoothscroll' is set, as the window should then
// be scrolled by screen lines.
if (curbuf->b_mod_set
&& curwin->w_p_wrap
&& !curwin->w_p_sms
&& !s->did_backspace
&& curwin->w_topline == s->old_topline
&& curwin->w_topfill == s->old_topfill) {