mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -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:
@@ -5190,6 +5190,7 @@ ex_echo(exarg_T *eap)
|
|||||||
|
|
||||||
CLEAR_FIELD(evalarg);
|
CLEAR_FIELD(evalarg);
|
||||||
evalarg.eval_flags = eap->skip ? 0 : EVAL_EVALUATE;
|
evalarg.eval_flags = eap->skip ? 0 : EVAL_EVALUATE;
|
||||||
|
evalarg.eval_cookie = eap->getline == getsourceline ? eap->cookie : NULL;
|
||||||
|
|
||||||
if (eap->skip)
|
if (eap->skip)
|
||||||
++emsg_skip;
|
++emsg_skip;
|
||||||
|
@@ -78,5 +78,28 @@ def Test_assign_dict()
|
|||||||
assert_equal({'0': 0, '1': 1, '2': 2}, nrd)
|
assert_equal({'0': 0, '1': 1, '2': 2}, nrd)
|
||||||
enddef
|
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
|
" vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker
|
||||||
|
@@ -754,6 +754,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1075,
|
||||||
/**/
|
/**/
|
||||||
1074,
|
1074,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user