Patch 8.2.3346

3 views
Skip to first unread message

Bram Moolenaar

unread,
Aug 14, 2021, 3:36:18 PM8/14/21
to vim...@googlegroups.com

Patch 8.2.3346
Problem: Vim9: no error for using "." for concatenation after ":vim9cmd".
(Naohiro Ono)
Solution: Check for Vim9 script syntax. (closes #8756)
Files: src/eval.c, src/testdir/test_vim9_cmd.vim


*** ../vim-8.2.3345/src/eval.c 2021-08-13 20:12:08.344119978 +0200
--- src/eval.c 2021-08-14 21:29:54.594147088 +0200
***************
*** 2860,2866 ****
// "++" and "--" on the next line are a separate command.
p = eval_next_non_blank(*arg, evalarg, &getnext);
op = *p;
! concat = op == '.' && (*(p + 1) == '.' || current_sctx.sc_version < 2);
if ((op != '+' && op != '-' && !concat) || p[1] == '='
|| (p[1] == '.' && p[2] == '='))
break;
--- 2860,2867 ----
// "++" and "--" on the next line are a separate command.
p = eval_next_non_blank(*arg, evalarg, &getnext);
op = *p;
! concat = op == '.' && (*(p + 1) == '.'
! || (current_sctx.sc_version < 2 && !vim9script));
if ((op != '+' && op != '-' && !concat) || p[1] == '='
|| (p[1] == '.' && p[2] == '='))
break;
*** ../vim-8.2.3345/src/testdir/test_vim9_cmd.vim 2021-08-13 19:40:47.417028286 +0200
--- src/testdir/test_vim9_cmd.vim 2021-08-14 21:31:06.814247908 +0200
***************
*** 14,19 ****
--- 14,20 ----
END
CheckScriptSuccess(lines)
assert_fails('vim9cmd', 'E1164:')
+ assert_fails('vim9cmd echo "con" . "cat"', 'E15:')

lines =<< trim END
vim9script
*** ../vim-8.2.3345/src/version.c 2021-08-14 21:11:47.500966948 +0200
--- src/version.c 2021-08-14 21:32:40.962324631 +0200
***************
*** 757,758 ****
--- 757,760 ----
{ /* Add new patch number below this line */
+ /**/
+ 3346,
/**/

--
An indication you must be a manager:
You give constructive feedback to your dog.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages