patch 8.2.4180: 'balloonexpr' is evaluated in the current script context
Problem: 'balloonexpr' is evaluated in the current script context.
Solution: Use the script context where the option was set.
diff --git a/src/option.c b/src/option.c
index 4cc6142..f6b6afa 100644
--- a/src/option.c
+++ b/src/option.c
@@ -2615,6 +2615,21 @@
}
/*
+ * Get the script context of global option "name".
+ *
+ */
+ sctx_T *
+get_option_sctx(char *name)
+{
+ int idx = findoption((char_u *)name);
+
+ if (idx >= 0)
+ return &options[idx].script_ctx;
+ siemsg("no such option: %s", name);
+ return NULL;
+}
+
+/*
* Set the script_ctx for a termcap option.
* "name" must be the two character code, e.g. "RV".
* When "name" is NULL use "opt_idx".