mirror of
https://github.com/neovim/neovim.git
synced 2026-08-29 18:41:48 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user