patch 9.1.1289: tests: no test for matchparen plugin with WinScrolled event
Problem: tests: no test for matchparen plugin with WinScrolled event
Solution: add missing test
closes: #10942
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/testdir/dumps/Test_matchparen_winscrolled1.dump b/src/testdir/dumps/Test_matchparen_winscrolled1.dump
new file mode 100644
index 0000000..60232cf
--- /dev/null
+++ b/src/testdir/dumps/Test_matchparen_winscrolled1.dump
@@ -0,0 +1,7 @@
+|f+0&#ffffff0|o@1|b|a|r| |{+0(ffff15| +0&#ffffff0@66
+@75
+@75
+@75
+>}+0(ffff15| +0&#ffffff0@73
+|~+0#4040ff13&| @73
+| +0#0000000&@56|5|,|1| @10|A|l@1|
diff --git a/src/testdir/dumps/Test_matchparen_winscrolled2.dump b/src/testdir/dumps/Test_matchparen_winscrolled2.dump
new file mode 100644
index 0000000..37f3792
--- /dev/null
+++ b/src/testdir/dumps/Test_matchparen_winscrolled2.dump
@@ -0,0 +1,7 @@
+| +0&#ffffff0@74
+@75
+@75
+>}| @73
+|~+0#4040ff13&| @73
+|~| @73
+| +0#0000000&@56|5|,|1| @10|B|o|t|
diff --git a/src/testdir/test_plugin_matchparen.vim b/src/testdir/test_plugin_matchparen.vim
index 13d6e9e..dca6e32 100644
--- a/src/testdir/test_plugin_matchparen.vim
+++ b/src/testdir/test_plugin_matchparen.vim
@@ -177,4 +177,28 @@
call StopVimInTerminal(buf)
endfunc
+" Test for the WinScrolled event
+func Test_scroll_winenter()
+ CheckScreendump
+
+ let lines =<< trim END
+ source $VIMRUNTIME/plugin/matchparen.vim
+ set scrolloff=1
+ call setline(1, ['foobar {', '', '', '', '}'])
+ call cursor(5, 1)
+ END
+
+ let filename = 'Xmatchparen_winscrolled'
+ call writefile(lines, filename, 'D')
+
+ let buf = RunVimInTerminal('-S '.filename, #{rows: 7})
+ call VerifyScreenDump(buf, 'Test_matchparen_winscrolled1', {})
+ call term_sendkeys(buf, "\<C-E>")
+ call VerifyScreenDump(buf, 'Test_matchparen_winscrolled2', {})
+ call term_sendkeys(buf, "\<C-Y>")
+ call VerifyScreenDump(buf, 'Test_matchparen_winscrolled1', {})
+
+ call StopVimInTerminal(buf)
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab
diff --git a/src/version.c b/src/version.c
index c9bcdca..9cfbe0b 100644
--- a/src/version.c
+++ b/src/version.c
@@ -705,6 +705,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1289,
+/**/
1288,
/**/
1287,