patch 8.1.1961: more functions can be used as a method
Problem: More functions can be used as a method.
Solution: Allow more functions to be used as a method. Add a test for
mapcheck().
diff --git a/src/testdir/test_match.vim b/src/testdir/test_match.vim
index 0bc1863..f55922b 100644
--- a/src/testdir/test_match.vim
+++ b/src/testdir/test_match.vim
@@ -15,7 +15,7 @@
2match MyGroup2 /FIXME/
3match MyGroup3 /XXX/
call assert_equal(['MyGroup1', 'TODO'], matcharg(1))
- call assert_equal(['MyGroup2', 'FIXME'], matcharg(2))
+ call assert_equal(['MyGroup2', 'FIXME'], 2->matcharg())
call assert_equal(['MyGroup3', 'XXX'], matcharg(3))
" --- Check that "matcharg()" returns an empty list if the argument is not 1,
@@ -44,7 +44,7 @@
" --- Check that "matchdelete()" deletes the matches defined in the previous
" --- test correctly.
call matchdelete(m1)
- call matchdelete(m2)
+ eval m2->matchdelete()
call matchdelete(m3)
call assert_equal([], getmatches())
@@ -56,7 +56,7 @@
" --- Check that "clearmatches()" clears all matches defined by ":match" and
" --- "matchadd()".
let m1 = matchadd("MyGroup1", "TODO")
- let m2 = matchadd("MyGroup2", "FIXME", 42)
+ let m2 = "MyGroup2"->matchadd("FIXME", 42)
let m3 = matchadd("MyGroup3", "XXX", 60, 17)
match MyGroup1 /COFFEE/
2match MyGroup2 /HUMPPA/
@@ -118,7 +118,7 @@
call clearmatches()
call setline(1, 'abcdΣabcdef')
- call matchaddpos("MyGroup1", [[1, 4, 2], [1, 9, 2]])
+ eval "MyGroup1"->matchaddpos([[1, 4, 2], [1, 9, 2]])
1
redraw!
let v1 = screenattr(1, 1)