patch 9.1.0753: Wrong display when typing in diff mode with 'smoothscroll'
Problem: Wrong display when typing in diff mode with 'smoothscroll'.
Solution: Use adjust_plines_for_skipcol() (zeertzjq).
closes: #15776
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/testdir/test_scroll_opt.vim b/src/testdir/test_scroll_opt.vim
index 47a3cf8..9c4e29e 100644
--- a/src/testdir/test_scroll_opt.vim
+++ b/src/testdir/test_scroll_opt.vim
@@ -302,6 +302,36 @@
call StopVimInTerminal(buf)
endfunc
+func Test_smoothscroll_diff_change_line()
+ CheckScreendump
+
+ let lines =<< trim END
+ set diffopt+=followwrap smoothscroll
+ call setline(1, repeat(' abc', &columns))
+ call setline(2, 'bar')
+ call setline(3, repeat(' abc', &columns))
+ vnew
+ call setline(1, repeat(' abc', &columns))
+ call setline(2, 'foo')
+ call setline(3, 'bar')
+ call setline(4, repeat(' abc', &columns))
+ windo exe "normal! 2gg5\<C-E>"
+ windo diffthis
+ END
+ call writefile(lines, 'XSmoothDiffChangeLine', 'D')
+ let buf = RunVimInTerminal('-S XSmoothDiffChangeLine', #{rows: 20, columns: 55})
+
+ call VerifyScreenDump(buf, 'Test_smooth_diff_change_line_1', {})
+ call term_sendkeys(buf, "Abar")
+ call VerifyScreenDump(buf, 'Test_smooth_diff_change_line_2', {})
+ call term_sendkeys(buf, "\<Esc>")
+ call VerifyScreenDump(buf, 'Test_smooth_diff_change_line_3', {})
+ call term_sendkeys(buf, "yyp")
+ call VerifyScreenDump(buf, 'Test_smooth_diff_change_line_4', {})
+
+ call StopVimInTerminal(buf)
+endfunc
+
func Test_smoothscroll_wrap_scrolloff_zero()
CheckScreendump