To: vim_dev@googlegroups.com Subject: Patch 8.2.3645 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.3645 Problem: Vim9: The "no effect" error is not given for all registers. Solution: Include any character following '@'. (closes #8779) Files: src/ex_eval.c, src/testdir/test_vim9_cmd.vim *** ../vim-8.2.3644/src/ex_eval.c 2021-10-23 12:34:18.409019076 +0100 --- src/ex_eval.c 2021-11-22 15:04:40.661598280 +0000 *************** *** 887,908 **** } } int cmd_is_name_only(char_u *arg) { char_u *p = arg; ! char_u *alias; int name_only = FALSE; ! if (*p == '&') { ++p; ! if (STRNCMP("l:", p, 2) == 0 || STRNCMP("g:", p, 2) == 0) ! p += 2; } - else if (*p == '@') - ++p; - get_name_len(&p, &alias, FALSE, FALSE); name_only = ends_excmd2(arg, skipwhite(p)); vim_free(alias); return name_only; --- 887,918 ---- } } + /* + * Return TRUE if "arg" is only a variable, register or option name. + */ int cmd_is_name_only(char_u *arg) { char_u *p = arg; ! char_u *alias = NULL; int name_only = FALSE; ! if (*p == '@') { ++p; ! if (*p != NUL) ! ++p; ! } ! else ! { ! if (*p == '&') ! { ! ++p; ! if (STRNCMP("l:", p, 2) == 0 || STRNCMP("g:", p, 2) == 0) ! p += 2; ! } ! get_name_len(&p, &alias, FALSE, FALSE); } name_only = ends_excmd2(arg, skipwhite(p)); vim_free(alias); return name_only; *** ../vim-8.2.3644/src/testdir/test_vim9_cmd.vim 2021-11-20 19:50:56.428908005 +0000 --- src/testdir/test_vim9_cmd.vim 2021-11-22 14:47:59.764048435 +0000 *************** *** 556,562 **** @a = 'echo "text"' @a END ! CheckDefAndScriptFailure(lines, 'E1207:') enddef def Test_environment_use_linebreak() --- 556,589 ---- @a = 'echo "text"' @a END ! CheckDefAndScriptFailure(lines, 'E1207:', 2) ! ! lines =<< trim END ! @/ = 'pattern' ! @/ ! END ! CheckDefAndScriptFailure(lines, 'E1207:', 2) ! ! lines =<< trim END ! &opfunc = 'nothing' ! &opfunc ! END ! CheckDefAndScriptFailure(lines, 'E1207:', 2) ! &opfunc = '' ! ! lines =<< trim END ! &l:showbreak = 'nothing' ! &l:showbreak ! END ! CheckDefAndScriptFailure(lines, 'E1207:', 2) ! &l:showbreak = '' ! ! lines =<< trim END ! &g:showbreak = 'nothing' ! &g:showbreak ! END ! CheckDefAndScriptFailure(lines, 'E1207:', 2) ! &g:showbreak = '' enddef def Test_environment_use_linebreak() *** ../vim-8.2.3644/src/version.c 2021-11-22 14:16:05.117603051 +0000 --- src/version.c 2021-11-22 15:05:01.541605051 +0000 *************** *** 759,760 **** --- 759,762 ---- { /* Add new patch number below this line */ + /**/ + 3645, /**/ -- Dreams are free, but there's a small charge for alterations. /// Bram Moolenaar -- Bram@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 ///