vim-patch:9.1.0009: Cannot easily get the list of matches (#27028)

Problem:  Cannot easily get the list of matches
Solution: Add the matchstrlist() and matchbufline() Vim script
          functions (Yegappan Lakshmanan)

closes: vim/vim#13766

Omit CHECK_LIST_MATERIALIZE(): it populates a List with numbers only,
and there is a check for strings below.

f93b1c881a

vim-patch:eb3475df0d92

runtime(doc): Replace non-breaking space with normal space (vim/vim#13868)

eb3475df0d

Co-authored-by: Yegappan Lakshmanan <4298407+yegappan@users.noreply.github.com>
This commit is contained in:
zeertzjq
2024-01-16 08:00:08 +08:00
committed by GitHub
parent ae48d965d7
commit 73e1942abe
11 changed files with 713 additions and 6 deletions

View File

@@ -42,6 +42,49 @@ func CheckScriptSuccess(lines)
endtry
endfunc
" :source a list of "lines" and check whether it fails with "error"
func CheckSourceFailure(lines, error, lnum = -3)
if get(a:lines, 0, '') ==# 'vim9script'
return
endif
new
call setline(1, a:lines)
try
call assert_fails('source', a:error, a:lines, a:lnum)
finally
bw!
endtry
endfunc
" :source a list of "lines" and check whether it fails with the list of
" "errors"
func CheckSourceFailureList(lines, errors, lnum = -3)
if get(a:lines, 0, '') ==# 'vim9script'
return
endif
new
call setline(1, a:lines)
try
call assert_fails('source', a:errors, a:lines, a:lnum)
finally
bw!
endtry
endfunc
" :source a list of "lines" and check whether it succeeds
func CheckSourceSuccess(lines)
if get(a:lines, 0, '') ==# 'vim9script'
return
endif
new
call setline(1, a:lines)
try
:source
finally
bw!
endtry
endfunc
func CheckDefAndScriptSuccess(lines)
return
endfunc