0
0
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:
Bram Moolenaar
2020-06-30 22:02:02 +02:00
parent 37c8371195
commit 47e880d6c1
3 changed files with 50 additions and 4 deletions

View File

@@ -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