" 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:
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