Mercurial > vim
changeset 22667:87987c783087 v8.2.1882
patch 8.2.1882: Vim9: v:disallow_let is no longer needed
Commit: https://github.com/vim/vim/commit/c58f5456e5c5f21193e960cecc434e367ef1281e
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Oct 21 20:58:52 2020 +0200
patch 8.2.1882: Vim9: v:disallow_let is no longer needed
Problem: Vim9: v:disallow_let is no longer needed.
Solution: Remove v:disallow_let.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 21 Oct 2020 21:00:04 +0200 |
parents | 7d3426b50a43 |
children | 7c0ebc6eb7ae |
files | src/evalvars.c src/version.c src/vim.h src/vim9compile.c |
diffstat | 4 files changed, 6 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/src/evalvars.c +++ b/src/evalvars.c @@ -146,7 +146,6 @@ static struct vimvar {VV_NAME("echospace", VAR_NUMBER), VV_RO}, {VV_NAME("argv", VAR_LIST), VV_RO}, {VV_NAME("collate", VAR_STRING), VV_RO}, - {VV_NAME("disallow_let", VAR_NUMBER), 0}, // TODO: remove }; // shorthand @@ -243,9 +242,6 @@ evalvars_init(void) set_vim_var_nr(VV_ECHOSPACE, sc_col - 1); - // TODO: remove later - set_vim_var_nr(VV_DISALLOW_LET, 1); - // Default for v:register is not 0 but '"'. This is adjusted once the // clipboard has been setup by calling reset_reg_var(). set_reg_var(0); @@ -749,8 +745,7 @@ ex_let(exarg_T *eap) ex_finally(eap); return; } - if (get_vim_var_nr(VV_DISALLOW_LET) - && eap->cmdidx == CMD_let && vim9script) + if (eap->cmdidx == CMD_let && vim9script) { emsg(_(e_cannot_use_let_in_vim9_script)); return;
--- a/src/version.c +++ b/src/version.c @@ -751,6 +751,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1882, +/**/ 1881, /**/ 1880,
--- a/src/vim.h +++ b/src/vim.h @@ -1994,8 +1994,7 @@ typedef int sock_T; #define VV_ECHOSPACE 93 #define VV_ARGV 94 #define VV_COLLATE 95 -#define VV_DISALLOW_LET 96 // TODO: remove again -#define VV_LEN 97 // number of v: vars +#define VV_LEN 96 // number of v: vars // used for v_number in VAR_BOOL and VAR_SPECIAL #define VVAL_FALSE 0L // VAR_BOOL
--- a/src/vim9compile.c +++ b/src/vim9compile.c @@ -7319,12 +7319,8 @@ compile_def_function(ufunc_T *ufunc, int break; case CMD_let: - if (get_vim_var_nr(VV_DISALLOW_LET)) - { - emsg(_(e_cannot_use_let_in_vim9_script)); - break; - } - // FALLTHROUGH + emsg(_(e_cannot_use_let_in_vim9_script)); + break; case CMD_var: case CMD_final: case CMD_const: