]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.1289: tests: no test for matchparen plugin with WinScrolled event v9.1.1289
authorChristian Brabandt <cb@256bit.org>
Wed, 9 Apr 2025 17:29:18 +0000 (19:29 +0200)
committerChristian Brabandt <cb@256bit.org>
Wed, 9 Apr 2025 17:29:18 +0000 (19:29 +0200)
Problem:  tests: no test for matchparen plugin with WinScrolled event
Solution: add missing test

closes: #10942

Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/plugin/matchparen.vim
src/testdir/dumps/Test_matchparen_winscrolled1.dump [new file with mode: 0644]
src/testdir/dumps/Test_matchparen_winscrolled2.dump [new file with mode: 0644]
src/testdir/test_plugin_matchparen.vim
src/version.c

index 1c8c9f3294d3673fbcb4763760f19ef52357c5e6..562148c19ed211087bbf34065a89a5f2234c7535 100644 (file)
@@ -1,6 +1,6 @@
 " Vim plugin for showing matching parens
 " Maintainer:  The Vim Project <https://github.com/vim/vim>
-" Last Change: 2025 Mar 14
+" Last Change: 2025 Apr 08
 " Former Maintainer:   Bram Moolenaar <Bram@vim.org>
 
 " Exit quickly when:
diff --git a/src/testdir/dumps/Test_matchparen_winscrolled1.dump b/src/testdir/dumps/Test_matchparen_winscrolled1.dump
new file mode 100644 (file)
index 0000000..60232cf
--- /dev/null
@@ -0,0 +1,7 @@
+|f+0&#ffffff0|o@1|b|a|r| |{+0&#40ffff15| +0&#ffffff0@66
+@75
+@75
+@75
+>}+0&#40ffff15| +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 (file)
index 0000000..37f3792
--- /dev/null
@@ -0,0 +1,7 @@
+| +0&#ffffff0@74
+@75
+@75
+>}| @73
+|~+0#4040ff13&| @73
+|~| @73
+| +0#0000000&@56|5|,|1| @10|B|o|t| 
index 13d6e9e11ac080203850771607837f1e7eb2adf6..dca6e3258b18e0ec7e38a14b88a0e2fe59e8b164 100644 (file)
@@ -177,4 +177,28 @@ func Test_matchparen_ignore_sh_case()
   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
index c9bcdcaaf951c07bf36b22edb5f775caba96781e..9cfbe0b2a399bdfa5c33acc801ccfa1cac40d973 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1289,
 /**/
     1288,
 /**/