diff src/evalvars.c @ 22480:5e95de50ddd2 v8.2.1788

patch 8.2.1788: Vim9: still allows :let for declarations Commit: https://github.com/vim/vim/commit/016faaa1b2fe242022725b29e1353c42105d045c Author: Bram Moolenaar <Bram@vim.org> Date: Sat Oct 3 12:57:27 2020 +0200 patch 8.2.1788: Vim9: still allows :let for declarations Problem: Vim9: still allows :let for declarations. Solution: Make the default for v:disallow_let one. It can still be set to zero to allow for using :let.
author Bram Moolenaar <Bram@vim.org>
date Sat, 03 Oct 2020 13:00:04 +0200
parents 1cefe1c013ac
children 2df99e237965
line wrap: on
line diff
--- a/src/evalvars.c
+++ b/src/evalvars.c
@@ -215,8 +215,8 @@ evalvars_init(void)
 	    // add to compat scope dict
 	    hash_add(&compat_hashtab, p->vv_di.di_key);
     }
-    vimvars[VV_VERSION].vv_nr = VIM_VERSION_100;
-    vimvars[VV_VERSIONLONG].vv_nr = VIM_VERSION_100 * 10000 + highest_patch();
+    set_vim_var_nr(VV_VERSION, VIM_VERSION_100);
+    set_vim_var_nr(VV_VERSIONLONG, VIM_VERSION_100 * 10000 + highest_patch());
 
     set_vim_var_nr(VV_SEARCHFORWARD, 1L);
     set_vim_var_nr(VV_HLSEARCH, 1L);
@@ -244,6 +244,9 @@ 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);