patch 9.0.0652: 'smoothscroll' not tested with 'number' and "n" in 'cpo'
Problem: 'smoothscroll' not tested with 'number' and "n" in 'cpo'.
Solution: Add tests, fix uncovered problem.
diff --git a/src/testdir/dumps/Test_smooth_number_1.dump b/src/testdir/dumps/Test_smooth_number_1.dump
new file mode 100644
index 0000000..7953319
--- /dev/null
+++ b/src/testdir/dumps/Test_smooth_number_1.dump
@@ -0,0 +1,12 @@
+| +0#af5f00255#ffffff0@1|1| |o+0#0000000&|n|e| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o
+|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o
+|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| @12
+| +0#af5f00255&@1|2| |t+0#0000000&|w|o| |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| |l|o
+|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| @2
+| +0#af5f00255&@1|3| >l+0#0000000&|i|n|e| @31
+| +0#af5f00255&@1|4| |l+0#0000000&|i|n|e| @31
+| +0#af5f00255&@1|5| |l+0#0000000&|i|n|e| @31
+|~+0#4040ff13&| @38
+|~| @38
+|~| @38
+| +0#0000000&@21|3|,|1| @10|A|l@1|
diff --git a/src/testdir/dumps/Test_smooth_number_2.dump b/src/testdir/dumps/Test_smooth_number_2.dump
new file mode 100644
index 0000000..110775d
--- /dev/null
+++ b/src/testdir/dumps/Test_smooth_number_2.dump
@@ -0,0 +1,12 @@
+|<+0#4040ff13#ffffff0@2|w+0#0000000&|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o
+|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| @12
+| +0#af5f00255&@1|2| |t+0#0000000&|w|o| |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| |l|o
+|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| @2
+| +0#af5f00255&@1|3| >l+0#0000000&|i|n|e| @31
+| +0#af5f00255&@1|4| |l+0#0000000&|i|n|e| @31
+| +0#af5f00255&@1|5| |l+0#0000000&|i|n|e| @31
+|~+0#4040ff13&| @38
+|~| @38
+|~| @38
+|~| @38
+| +0#0000000&@21|3|,|1| @10|A|l@1|
diff --git a/src/testdir/dumps/Test_smooth_number_3.dump b/src/testdir/dumps/Test_smooth_number_3.dump
new file mode 100644
index 0000000..3f35de6
--- /dev/null
+++ b/src/testdir/dumps/Test_smooth_number_3.dump
@@ -0,0 +1,12 @@
+|<+0#4040ff13#ffffff0@2|w+0#0000000&|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| @12
+| +0#af5f00255&@1|2| |t+0#0000000&|w|o| |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| |l|o
+|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| @2
+| +0#af5f00255&@1|3| >l+0#0000000&|i|n|e| @31
+| +0#af5f00255&@1|4| |l+0#0000000&|i|n|e| @31
+| +0#af5f00255&@1|5| |l+0#0000000&|i|n|e| @31
+|~+0#4040ff13&| @38
+|~| @38
+|~| @38
+|~| @38
+|~| @38
+| +0#0000000&@21|3|,|1| @10|A|l@1|
diff --git a/src/testdir/dumps/Test_smooth_number_4.dump b/src/testdir/dumps/Test_smooth_number_4.dump
new file mode 100644
index 0000000..6ea393d
--- /dev/null
+++ b/src/testdir/dumps/Test_smooth_number_4.dump
@@ -0,0 +1,12 @@
+|<+0#4040ff13#ffffff0@2| +0#af5f00255&|d+0#0000000&| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| @4
+| +0#af5f00255&@1|2| |t+0#0000000&|w|o| |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| |l|o
+| +0#af5f00255&@3|n+0#0000000&|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r
+| +0#af5f00255&@3|d+0#0000000&| @34
+| +0#af5f00255&@1|3| >l+0#0000000&|i|n|e| @31
+| +0#af5f00255&@1|4| |l+0#0000000&|i|n|e| @31
+| +0#af5f00255&@1|5| |l+0#0000000&|i|n|e| @31
+|~+0#4040ff13&| @38
+|~| @38
+|~| @38
+|~| @38
+|:+0#0000000&|s|e|t| |c|p|o|-|=|n| @10|3|,|1| @10|A|l@1|
diff --git a/src/testdir/dumps/Test_smooth_number_5.dump b/src/testdir/dumps/Test_smooth_number_5.dump
new file mode 100644
index 0000000..4602de2
--- /dev/null
+++ b/src/testdir/dumps/Test_smooth_number_5.dump
@@ -0,0 +1,12 @@
+|<+0#4040ff13#ffffff0@2| +0#af5f00255&|r+0#0000000&|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r
+| +0#af5f00255&@3|d+0#0000000&| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| @4
+| +0#af5f00255&@1|2| |t+0#0000000&|w|o| |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| |l|o
+| +0#af5f00255&@3|n+0#0000000&|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r
+| +0#af5f00255&@3|d+0#0000000&| @34
+| +0#af5f00255&@1|3| >l+0#0000000&|i|n|e| @31
+| +0#af5f00255&@1|4| |l+0#0000000&|i|n|e| @31
+| +0#af5f00255&@1|5| |l+0#0000000&|i|n|e| @31
+|~+0#4040ff13&| @38
+|~| @38
+|~| @38
+|:+0#0000000&|s|e|t| |c|p|o|-|=|n| @10|3|,|1| @10|A|l@1|
diff --git a/src/testdir/dumps/Test_smooth_number_6.dump b/src/testdir/dumps/Test_smooth_number_6.dump
new file mode 100644
index 0000000..bec58b5
--- /dev/null
+++ b/src/testdir/dumps/Test_smooth_number_6.dump
@@ -0,0 +1,12 @@
+| +0#af5f00255#ffffff0@1|1| |o+0#0000000&|n|e| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o
+| +0#af5f00255&@3|r+0#0000000&|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r
+| +0#af5f00255&@3|d+0#0000000&| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| @4
+| +0#af5f00255&@1|2| |t+0#0000000&|w|o| |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| |l|o
+| +0#af5f00255&@3|n+0#0000000&|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r
+| +0#af5f00255&@3|d+0#0000000&| @34
+| +0#af5f00255&@1|3| >l+0#0000000&|i|n|e| @31
+| +0#af5f00255&@1|4| |l+0#0000000&|i|n|e| @31
+| +0#af5f00255&@1|5| |l+0#0000000&|i|n|e| @31
+|~+0#4040ff13&| @38
+|~| @38
+|:+0#0000000&|s|e|t| |c|p|o|-|=|n| @10|3|,|1| @10|A|l@1|
diff --git a/src/testdir/test_scroll_opt.vim b/src/testdir/test_scroll_opt.vim
index e23068f..5dfc697 100644
--- a/src/testdir/test_scroll_opt.vim
+++ b/src/testdir/test_scroll_opt.vim
@@ -106,6 +106,41 @@
call StopVimInTerminal(buf)
endfunc
+func Test_smoothscroll_number()
+ CheckScreendump
+
+ let lines =<< trim END
+ vim9script
+ setline(1, [
+ 'one ' .. 'word '->repeat(20),
+ 'two ' .. 'long word '->repeat(7),
+ 'line',
+ 'line',
+ 'line',
+ ])
+ set smoothscroll
+ set number cpo+=n
+ :3
+ END
+ call writefile(lines, 'XSmoothNumber', 'D')
+ let buf = RunVimInTerminal('-S XSmoothNumber', #{rows: 12, cols: 40})
+
+ call VerifyScreenDump(buf, 'Test_smooth_number_1', {})
+ call term_sendkeys(buf, "\<C-E>")
+ call VerifyScreenDump(buf, 'Test_smooth_number_2', {})
+ call term_sendkeys(buf, "\<C-E>")
+ call VerifyScreenDump(buf, 'Test_smooth_number_3', {})
+
+ call term_sendkeys(buf, ":set cpo-=n\<CR>")
+ call VerifyScreenDump(buf, 'Test_smooth_number_4', {})
+ call term_sendkeys(buf, "\<C-Y>")
+ call VerifyScreenDump(buf, 'Test_smooth_number_5', {})
+ call term_sendkeys(buf, "\<C-Y>")
+ call VerifyScreenDump(buf, 'Test_smooth_number_6', {})
+
+ call StopVimInTerminal(buf)
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab