aboutsummaryrefslogtreecommitdiff
path: root/test/old
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-08-25 06:07:43 +0800
committerGitHub <noreply@github.com>2024-08-25 06:07:43 +0800
commitcf44121f7fb6f55a22e644a1e5e1f1dc6b90c27a (patch)
tree5c98c222adf773301fc32f847dbb20618899ecf9 /test/old
parent84f1c5e072565f946f8632fb72424553b773f8c0 (diff)
downloadrneovim-cf44121f7fb6f55a22e644a1e5e1f1dc6b90c27a.tar.gz
rneovim-cf44121f7fb6f55a22e644a1e5e1f1dc6b90c27a.tar.bz2
rneovim-cf44121f7fb6f55a22e644a1e5e1f1dc6b90c27a.zip
vim-patch:9.1.0694: matchparen is slow on a long line (#30134)
Problem: The matchparen plugin is slow on a long line. Solution: Don't use a regexp to get char at and before cursor. (zeertzjq) Example: ```vim call setline(1, repeat(' foobar', 100000)) runtime plugin/matchparen.vim normal! $hhhhhhhh ``` closes: vim/vim#15568 https://github.com/vim/vim/commit/81e7513c86459c40676bd983f73c2722096d67a9
Diffstat (limited to 'test/old')
-rw-r--r--test/old/testdir/test_matchparen.vim30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/old/testdir/test_matchparen.vim b/test/old/testdir/test_matchparen.vim
index ab425b046a..7d80e43046 100644
--- a/test/old/testdir/test_matchparen.vim
+++ b/test/old/testdir/test_matchparen.vim
@@ -108,5 +108,35 @@ func Test_matchparen_pum_clear()
call StopVimInTerminal(buf)
endfunc
+" Test that matchparen works with multibyte chars in 'matchpairs'
+func Test_matchparen_mbyte()
+ CheckScreendump
+
+ let lines =<< trim END
+ source $VIMRUNTIME/plugin/matchparen.vim
+ call setline(1, ['aaaaaaaa(', 'bbbb)cc'])
+ set matchpairs+=(:)
+ END
+
+ call writefile(lines, 'XmatchparenMbyte', 'D')
+ let buf = RunVimInTerminal('-S XmatchparenMbyte', #{rows: 10})
+ call VerifyScreenDump(buf, 'Test_matchparen_mbyte_1', {})
+ call term_sendkeys(buf, "$")
+ call VerifyScreenDump(buf, 'Test_matchparen_mbyte_2', {})
+ call term_sendkeys(buf, "j")
+ call VerifyScreenDump(buf, 'Test_matchparen_mbyte_3', {})
+ call term_sendkeys(buf, "2h")
+ call VerifyScreenDump(buf, 'Test_matchparen_mbyte_4', {})
+ call term_sendkeys(buf, "0")
+ call VerifyScreenDump(buf, 'Test_matchparen_mbyte_5', {})
+ call term_sendkeys(buf, "kA")
+ call VerifyScreenDump(buf, 'Test_matchparen_mbyte_6', {})
+ call term_sendkeys(buf, "\<Down>")
+ call VerifyScreenDump(buf, 'Test_matchparen_mbyte_7', {})
+ call term_sendkeys(buf, "\<C-W>")
+ call VerifyScreenDump(buf, 'Test_matchparen_mbyte_8', {})
+
+ call StopVimInTerminal(buf)
+endfunc
" vim: shiftwidth=2 sts=2 expandtab