0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.2.1075: Vim9: no line break allowed in :echo expression

Problem:    Vim9: no line break allowed in :echo expression.
Solution:   Skip linebreak.
This commit is contained in:
Bram Moolenaar
2020-06-27 21:56:17 +02:00
parent 9215f01218
commit 7e8967fdcd
3 changed files with 26 additions and 0 deletions

View File

@@ -5190,6 +5190,7 @@ ex_echo(exarg_T *eap)
CLEAR_FIELD(evalarg);
evalarg.eval_flags = eap->skip ? 0 : EVAL_EVALUATE;
evalarg.eval_cookie = eap->getline == getsourceline ? eap->cookie : NULL;
if (eap->skip)
++emsg_skip;

View File

@@ -78,5 +78,28 @@ def Test_assign_dict()
assert_equal({'0': 0, '1': 1, '2': 2}, nrd)
enddef
def Test_echo_linebreak()
let lines =<< trim END
vim9script
redir @a
echo 'one'
.. 'two'
redir END
assert_equal("\nonetwo", @a)
END
CheckScriptSuccess(lines)
lines =<< trim END
vim9script
redir @a
echo 11 +
77
- 22
redir END
assert_equal("\n66", @a)
END
CheckScriptSuccess(lines)
enddef
" vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker

View File

@@ -754,6 +754,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1075,
/**/
1074,
/**/