diff src/buffer.c @ 23390:9a5f12b36273 v8.2.2238

patch 8.2.2238: Vim9: cannot load a Vim9 script without the +eval feature Commit: https://github.com/vim/vim/commit/9b8d62267f583d5dc042920adb1de046959ad11d Author: Bram Moolenaar <Bram@vim.org> Date: Mon Dec 28 18:26:00 2020 +0100 patch 8.2.2238: Vim9: cannot load a Vim9 script without the +eval feature Problem: Vim9: cannot load a Vim9 script without the +eval feature. Solution: Support Vim9 script syntax without the +eval feature.
author Bram Moolenaar <Bram@vim.org>
date Mon, 28 Dec 2020 18:30:03 +0100
parents a84e7abb0c92
children f9d02c83f306
line wrap: on
line diff
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -5371,9 +5371,8 @@ chk_modeline(
     int		vers;
     int		end;
     int		retval = OK;
-#ifdef FEAT_EVAL
     sctx_T	save_current_sctx;
-#endif
+
     ESTACK_CHECK_DECLARATION
 
     prev = -1;
@@ -5457,22 +5456,22 @@ chk_modeline(
 	    if (*s != NUL)		// skip over an empty "::"
 	    {
 		int secure_save = secure;
+
+		save_current_sctx = current_sctx;
+		current_sctx.sc_version = 1;
 #ifdef FEAT_EVAL
-		save_current_sctx = current_sctx;
 		current_sctx.sc_sid = SID_MODELINE;
 		current_sctx.sc_seq = 0;
 		current_sctx.sc_lnum = lnum;
-		current_sctx.sc_version = 1;
-#endif
+#endif
+
 		// Make sure no risky things are executed as a side effect.
 		secure = 1;
 
 		retval = do_set(s, OPT_MODELINE | OPT_LOCAL | flags);
 
 		secure = secure_save;
-#ifdef FEAT_EVAL
 		current_sctx = save_current_sctx;
-#endif
 		if (retval == FAIL)		// stop if error found
 		    break;
 	    }