patch 8.2.2834: Vim9: :cexpr does not work with local variables
Problem: Vim9: :cexpr does not work with local variables.
Solution: Compile :cexpr.
diff --git a/src/vim9.h b/src/vim9.h
index 5dc0a8f..94cc243 100644
--- a/src/vim9.h
+++ b/src/vim9.h
@@ -172,6 +172,9 @@
ISN_REDIRSTART, // :redir =>
ISN_REDIREND, // :redir END, isn_arg.number == 1 for append
+ ISN_CEXPR_AUCMD, // first part of :cexpr isn_arg.number is cmdidx
+ ISN_CEXPR_CORE, // second part of :cexpr, uses isn_arg.cexpr
+
ISN_FINISH // end marker in list of instructions
} isntype_T;
@@ -352,6 +355,18 @@
isn_T *subs_instr; // sequence of instructions
} subs_T;
+// indirect arguments to ISN_TRY
+typedef struct {
+ int cer_cmdidx;
+ char_u *cer_cmdline;
+ int cer_forceit;
+} cexprref_T;
+
+// arguments to ISN_CEXPR_CORE
+typedef struct {
+ cexprref_T *cexpr_ref;
+} cexpr_T;
+
/*
* Instruction
*/
@@ -395,6 +410,7 @@
unpack_T unpack;
isn_outer_T outer;
subs_T subs;
+ cexpr_T cexpr;
} isn_arg;
};