patch 8.2.4173: cannot use an import in 'foldexpr'
Problem: Cannot use an import in 'foldexpr'.
Solution: Set the script context to where 'foldexpr' was set. (closes #9584)
Fix that the script context was not set for all buffers.
diff --git a/src/option.c b/src/option.c
index 2ec6ed5..4cc6142 100644
--- a/src/option.c
+++ b/src/option.c
@@ -2604,7 +2604,13 @@
if (indir & PV_BUF)
curbuf->b_p_script_ctx[indir & PV_MASK] = new_script_ctx;
else if (indir & PV_WIN)
+ {
curwin->w_p_script_ctx[indir & PV_MASK] = new_script_ctx;
+ if (both)
+ // also setting the "all buffers" value
+ curwin->w_allbuf_opt.wo_script_ctx[indir & PV_MASK] =
+ new_script_ctx;
+ }
}
}