0
0
mirror of https://github.com/vim/vim.git synced 2025-10-02 05:04:20 -04:00

patch 8.2.2137: Vim9: :echo and :execute give error for empty argument

Problem:    Vim9: :echo and :execute give error for empty argument.
Solution:   Ignore an empty argument. (closes #7468)
This commit is contained in:
Bram Moolenaar
2020-12-13 14:19:25 +01:00
parent c530852315
commit e498429087
5 changed files with 51 additions and 26 deletions

View File

@@ -620,7 +620,7 @@ def Test_try_catch_fails()
CheckDefFailure(['if 1', 'endtry'], 'E171:')
CheckDefFailure(['try', 'echo 1', 'endtry'], 'E1032:')
CheckDefFailure(['throw'], 'E1015:')
CheckDefFailure(['throw'], 'E1143:')
CheckDefFailure(['throw xxx'], 'E1001:')
enddef
@@ -1719,6 +1719,10 @@ def Test_nested_if()
enddef
def Test_execute_cmd()
# missing argument is ignored
execute
execute # comment
new
setline(1, 'default')
execute 'setline(1, "execute-string")'
@@ -2137,9 +2141,6 @@ def Test_vim9_comment()
'vim9script',
'exe "echo"# something',
], 'E121:')
CheckDefFailure([
'exe # comment',
], 'E1015:')
CheckScriptFailure([
'vim9script',
'exe# something',
@@ -2164,7 +2165,7 @@ def Test_vim9_comment()
' throw#comment',
'catch',
'endtry',
], 'E1015:')
], 'E1143:')
CheckDefFailure([
'try',
' throw "yes"#comment',