patch 9.0.1512: inserting lines when scrolling with 'smoothscroll' set
Problem: Inserting lines when scrolling with 'smoothscroll' set.
Solution: Adjust line height computation for w_skipcol. (Luuk van Baal,
closes #12350)
diff --git a/src/testdir/dumps/Test_smooth_ins_lines.dump b/src/testdir/dumps/Test_smooth_ins_lines.dump
new file mode 100644
index 0000000..a085452
--- /dev/null
+++ b/src/testdir/dumps/Test_smooth_ins_lines.dump
@@ -0,0 +1,6 @@
+|<+0#4040ff13#ffffff0@2|l+0#0000000&|o|t|s| |o|f| |t|e|x|t| |i|n| |o|n|e| |l|i|n|e> @12
+|l|i|n|e| |t|w|o| @31
+|l|i|n|e| |t|h|r|e@1| @29
+|l|i|n|e| |f|o|u|r| @30
+|l|i|n|e| |f|i|v|e| @30
+@22|1|,|6|8| @9|A|l@1|
diff --git a/src/testdir/test_scroll_opt.vim b/src/testdir/test_scroll_opt.vim
index bab1e08..da19127 100644
--- a/src/testdir/test_scroll_opt.vim
+++ b/src/testdir/test_scroll_opt.vim
@@ -587,7 +587,7 @@
endfunc
" this was dividing by zero
-func Test_smoothscrol_zero_width()
+func Test_smoothscroll_zero_width()
CheckScreendump
let lines =<< trim END
@@ -613,5 +613,30 @@
call StopVimInTerminal(buf)
endfunc
+" this was unnecessarily inserting lines
+func Test_smoothscroll_ins_lines()
+ CheckScreendump
+
+ let lines =<< trim END
+ set wrap
+ set smoothscroll
+ set scrolloff=0
+ set conceallevel=2
+ call setline(1, [
+ \'line one' .. 'with lots of text in one line '->repeat(2),
+ \'line two',
+ \'line three',
+ \'line four',
+ \'line five'
+ \])
+ END
+ call writefile(lines, 'XSmoothScrollInsLines', 'D')
+ let buf = RunVimInTerminal('-S XSmoothScrollInsLines', #{rows: 6, cols: 40})
+
+ call term_sendkeys(buf, "\<C-E>gjgk")
+ call VerifyScreenDump(buf, 'Test_smooth_ins_lines', {})
+
+ call StopVimInTerminal(buf)
+endfunc
" vim: shiftwidth=2 sts=2 expandtab