aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-10-01 18:32:08 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-10-02 07:28:38 +0800
commit85c7d4f7a92326dcd70317b048bafe96c8051701 (patch)
treefa1284ca2c4eccbaf495d8135c6bbd97f81cb646 /src/nvim/testdir
parent01721aaa667f7fe32f5b9fbf7b6fd99cb775de48 (diff)
downloadrneovim-85c7d4f7a92326dcd70317b048bafe96c8051701.tar.gz
rneovim-85c7d4f7a92326dcd70317b048bafe96c8051701.tar.bz2
rneovim-85c7d4f7a92326dcd70317b048bafe96c8051701.zip
vim-patch:9.0.0620: matchaddpos() can only add up to 8 matches
Problem: matchaddpos() can only add up to 8 matches. Solution: Allocate the array of positions. (closes vim/vim#11248) https://github.com/vim/vim/commit/50faf02f43d7f1a56ec2023028fca7c72dbce83e
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_match.vim16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_match.vim b/src/nvim/testdir/test_match.vim
index 70271aa32f..784c966a5d 100644
--- a/src/nvim/testdir/test_match.vim
+++ b/src/nvim/testdir/test_match.vim
@@ -2,6 +2,7 @@
" matchaddpos(), matcharg(), matchdelete(), and setmatches().
source screendump.vim
+source check.vim
function Test_match()
highlight MyGroup1 term=bold ctermbg=red guibg=red
@@ -219,6 +220,21 @@ func Test_matchaddpos()
set hlsearch&
endfunc
+" Add 12 match positions (previously the limit was 8 positions).
+func Test_matchaddpos_dump()
+ CheckScreendump
+
+ let lines =<< trim END
+ call setline(1, ['1234567890123']->repeat(14))
+ call matchaddpos('Search', range(1, 12)->map({i, v -> [v, v]}))
+ END
+ call writefile(lines, 'Xmatchaddpos', 'D')
+ let buf = RunVimInTerminal('-S Xmatchaddpos', #{rows: 14})
+ call VerifyScreenDump(buf, 'Test_matchaddpos_1', {})
+
+ call StopVimInTerminal(buf)
+endfunc
+
func Test_matchaddpos_otherwin()
syntax on
new