mirror of
https://github.com/vim/vim.git
synced 2025-09-29 04:34:16 -04:00
patch 8.2.1100: Vim9: cannot use line break in :execute argument
Problem: Vim9: cannot use line break in :execute, :echomsg and :echoerr argument. Solution: Check for line break.
This commit is contained in:
@@ -1294,6 +1294,19 @@ def Test_execute_cmd()
|
||||
call CheckDefFailure(['execute "cmd"# comment'], 'E488:')
|
||||
enddef
|
||||
|
||||
def Test_execute_cmd_vimscript()
|
||||
" only checks line continuation
|
||||
let lines =<< trim END
|
||||
vim9script
|
||||
execute 'g:someVar'
|
||||
.. ' = ' ..
|
||||
'28'
|
||||
assert_equal(28, g:someVar)
|
||||
unlet g:someVar
|
||||
END
|
||||
CheckScriptSuccess(lines)
|
||||
enddef
|
||||
|
||||
def Test_echo_cmd()
|
||||
echo 'some' # comment
|
||||
echon 'thing'
|
||||
@@ -1321,6 +1334,18 @@ def Test_echomsg_cmd()
|
||||
call CheckDefFailure(['echomsg "xxx"# comment'], 'E488:')
|
||||
enddef
|
||||
|
||||
def Test_echomsg_cmd_vimscript()
|
||||
" only checks line continuation
|
||||
let lines =<< trim END
|
||||
vim9script
|
||||
echomsg 'here'
|
||||
.. ' is ' ..
|
||||
'a message'
|
||||
assert_match('^here is a message$', Screenline(&lines))
|
||||
END
|
||||
CheckScriptSuccess(lines)
|
||||
enddef
|
||||
|
||||
def Test_echoerr_cmd()
|
||||
try
|
||||
echoerr 'something' 'wrong' # comment
|
||||
@@ -1329,6 +1354,21 @@ def Test_echoerr_cmd()
|
||||
endtry
|
||||
enddef
|
||||
|
||||
def Test_echoerr_cmd_vimscript()
|
||||
" only checks line continuation
|
||||
let lines =<< trim END
|
||||
vim9script
|
||||
try
|
||||
echoerr 'this'
|
||||
.. ' is ' ..
|
||||
'wrong'
|
||||
catch
|
||||
assert_match('this is wrong', v:exception)
|
||||
endtry
|
||||
END
|
||||
CheckScriptSuccess(lines)
|
||||
enddef
|
||||
|
||||
def Test_for_outside_of_function()
|
||||
let lines =<< trim END
|
||||
vim9script
|
||||
|
Reference in New Issue
Block a user