Patch 8.2.3656

6 views
Skip to first unread message

Bram Moolenaar

unread,
Nov 23, 2021, 9:52:54 AM11/23/21
to vim...@googlegroups.com

Patch 8.2.3656
Problem: Vim9: no error for an evironment variable by itself.
Solution: Give a "without effect" error. (closes #9166)
Files: src/ex_eval.c, src/testdir/test_vim9_cmd.vim


*** ../vim-8.2.3655/src/ex_eval.c 2021-11-22 18:30:59.647943922 +0000
--- src/ex_eval.c 2021-11-23 14:50:45.437557453 +0000
***************
*** 888,894 ****
}

/*
! * Return TRUE if "arg" is only a variable, register or option name.
*/
int
cmd_is_name_only(char_u *arg)
--- 888,895 ----
}

/*
! * Return TRUE if "arg" is only a variable, register, environment variable or
! * option name.
*/
int
cmd_is_name_only(char_u *arg)
***************
*** 911,916 ****
--- 912,919 ----
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-8.2.3655/src/testdir/test_vim9_cmd.vim 2021-11-22 21:58:37.918668436 +0000
--- src/testdir/test_vim9_cmd.vim 2021-11-23 14:50:12.973604807 +0000
***************
*** 584,589 ****
--- 584,596 ----
END
CheckDefAndScriptFailure(lines, 'E1207:', 2)
&g:showbreak = ''
+
+ lines =<< trim END
+ $SomeEnv = 'value'
+ $SomeEnv
+ END
+ CheckDefAndScriptFailure(lines, 'E1207:', 2)
+ $SomeEnv = ''
enddef

def Test_environment_use_linebreak()
*** ../vim-8.2.3655/src/version.c 2021-11-23 12:35:54.350064548 +0000
--- src/version.c 2021-11-23 14:48:39.737744356 +0000
***************
*** 759,760 ****
--- 759,762 ----
{ /* Add new patch number below this line */
+ /**/
+ 3656,
/**/

--
Men may not be seen publicly in any kind of strapless gown.
[real standing law in Florida, United States of America]

/// 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