From: Bram Moolenaar Date: Sat, 27 Jun 2020 19:56:17 +0000 (+0200) Subject: patch 8.2.1075: Vim9: no line break allowed in :echo expression X-Git-Tag: v8.2.1075 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7e8967fdcdf45caf08753bb791dc3779e78b34c8;p=vim patch 8.2.1075: Vim9: no line break allowed in :echo expression Problem: Vim9: no line break allowed in :echo expression. Solution: Skip linebreak. --- diff --git a/src/eval.c b/src/eval.c index ca98d2eb0..736023930 100644 --- a/src/eval.c +++ b/src/eval.c @@ -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; diff --git a/src/testdir/test_vim9_cmd.vim b/src/testdir/test_vim9_cmd.vim index 55d756a67..2d5bf4516 100644 --- a/src/testdir/test_vim9_cmd.vim +++ b/src/testdir/test_vim9_cmd.vim @@ -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 diff --git a/src/version.c b/src/version.c index dc0552189..c304fe5cc 100644 --- a/src/version.c +++ b/src/version.c @@ -754,6 +754,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1075, /**/ 1074, /**/