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 -- [email protected] -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/20211123145249.6391D1C3DF9%40moolenaar.net.