changeset 21048:524fa1d42e1e v8.2.1075

patch 8.2.1075: Vim9: no line break allowed in :echo expression Commit: https://github.com/vim/vim/commit/7e8967fdcdf45caf08753bb791dc3779e78b34c8 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jun 27 21:56:17 2020 +0200 patch 8.2.1075: Vim9: no line break allowed in :echo expression Problem: Vim9: no line break allowed in :echo expression. Solution: Skip linebreak.
author Bram Moolenaar <Bram@vim.org>
date Sat, 27 Jun 2020 22:00:04 +0200
parents 58d7b08e0e6a
children 4b256059a255
files src/eval.c src/testdir/test_vim9_cmd.vim src/version.c
diffstat 3 files changed, 26 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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;
--- 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
--- a/src/version.c
+++ b/src/version.c
@@ -755,6 +755,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1075,
+/**/
     1074,
 /**/
     1073,