vim-patch:7.4.1685

Problem:    There is no easy way to get all the information about a match.
Solution:   Add matchstrpos(). (Ozaki Kiichi)

7fed5c18f8
This commit is contained in:
Michael Ennen
2016-11-24 23:13:30 -07:00
parent 6115029496
commit 6fea2dfd26
7 changed files with 70 additions and 5 deletions

View File

@@ -9,6 +9,7 @@ source test_expr.vim
source test_expr_utf8.vim
source test_feedkeys.vim
source test_goto.vim
source test_matchstrpos.vim
source test_menu.vim
source test_messages.vim
source test_options.vim

View File

@@ -0,0 +1,13 @@
" Test matchstrpos
func Test_matchstrpos()
call assert_equal(['ing', 4, 7], matchstrpos('testing', 'ing'))
call assert_equal(['ing', 4, 7], matchstrpos('testing', 'ing', 2))
call assert_equal(['', -1, -1], matchstrpos('testing', 'ing', 5))
call assert_equal(['ing', 1, 4, 7], matchstrpos(['vim', 'testing', 'execute'], 'ing'))
call assert_equal(['', -1, -1, -1], matchstrpos(['vim', 'testing', 'execute'], 'img'))
endfunc